diff options
Diffstat (limited to 'html.class')
-rw-r--r-- | html.class | 18 |
1 files changed, 2 insertions, 16 deletions
@@ -315,23 +315,9 @@ function u(/* ... */) $base = preg_replace('|\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 = array(); + $queryparams = it_url::params($params); - foreach ($params as $key => $value) - { - if (is_array($value)) - { - foreach ($value as $arrkey => $arrvalue) - { - if (strlen($arrvalue)) - $queryparams[] = urlencode($key) . "[" . urlencode($arrkey) . "]=" . it_url::encode($arrvalue); - } - } - else if (strlen($value)) - $queryparams[] = urlencode($key) . "=" . it_url::encode($value); - } - - return $base . ($queryparams ? ("?" . join("&", $queryparams)) : ""); + return $base . ($queryparams ? "?$queryparams" : ""); } |