diff options
author | Christian Schneider | 2007-08-22 16:59:02 +0000 |
---|---|---|
committer | Christian Schneider | 2007-08-22 16:59:02 +0000 |
commit | 6868ea1b60f85543866c8791425d58e8773f8605 (patch) | |
tree | 5bd6df4e52fed818a2565fedd18780db47d7f90f /it_html.class | |
parent | 0d4199a23021f4033c66f4c6a22e2654eb4b5c2e (diff) | |
download | itools-6868ea1b60f85543866c8791425d58e8773f8605.tar.gz itools-6868ea1b60f85543866c8791425d58e8773f8605.tar.bz2 itools-6868ea1b60f85543866c8791425d58e8773f8605.zip |
U() now also handles base urls with parameters
Diffstat (limited to 'it_html.class')
-rw-r--r-- | it_html.class | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/it_html.class b/it_html.class index 0375891..af0ab26 100644 --- a/it_html.class +++ b/it_html.class @@ -313,11 +313,12 @@ function u(/* ... */) $base = $_SERVER['PHP_SELF']; $base = preg_replace('|\0|', '', $base); - $base = preg_replace('|[^\w.+!*(),:@&=/~$-]|e', 'urlencode("$0")', $base); + $base = preg_replace('|[^\w.+!*(),:?@&=/~$-]|e', 'urlencode("$0")', $base); $base = preg_replace('|^(\w+:)?//[^/]*$|', '$0/', $base); # Add slash if absolute url without a path, e.g. http://gna.ch $queryparams = it_url::params($params); - - return $base . ($queryparams ? "?$queryparams" : ""); + $separator = strpos($base, "?") === false ? "?" : "&"; + + return $base . ($queryparams ? "$separator$queryparams" : ""); } @@ -505,7 +506,7 @@ function head($args = array()) $checksum = itjs::checksum(itjs::filenames($p['js'])); $js .= $this->_itjs("boot.js", "inline"); $js .= "function it_boot_start(){ " . trim($p['jsboot']) . " }\n"; - $js .= "it_boot('/itjs/" . $p['js'] . (strpos($p['js'], "?") ? "&" : "?") . "s=$checksum');\n"; + $js .= "it_boot('/itjs/" . it_html::U($p['js'], 's' => $checksum) . "');\n"; } $js .= $this->_itjs($p['jsinline'], 'inline'); |