diff options
author | Christian Schneider | 2007-02-13 16:28:13 +0000 |
---|---|---|
committer | Christian Schneider | 2007-02-13 16:28:13 +0000 |
commit | cc4ddb57a83e2c5c922f03e1151680b3e59b1263 (patch) | |
tree | c4b246616acfef66bf44935077bd64d5a31beea4 /html.class | |
parent | 40c23e8e6ae2579fa279416b9f2fda5874b360a7 (diff) | |
download | itools-cc4ddb57a83e2c5c922f03e1151680b3e59b1263.tar.gz itools-cc4ddb57a83e2c5c922f03e1151680b3e59b1263.tar.bz2 itools-cc4ddb57a83e2c5c922f03e1151680b3e59b1263.zip |
Added it_url::params (handles nested arrays) and use it in U() and search_url
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" : ""); } |