summaryrefslogtreecommitdiff
path: root/html.class
diff options
context:
space:
mode:
Diffstat (limited to 'html.class')
-rw-r--r--html.class18
1 files changed, 2 insertions, 16 deletions
diff --git a/html.class b/html.class
index ccacfea..d1fb5d2 100644
--- a/html.class
+++ b/html.class
@@ -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" : "");
}