summaryrefslogtreecommitdiff
path: root/it_html.class
diff options
context:
space:
mode:
Diffstat (limited to 'it_html.class')
-rw-r--r--it_html.class6
1 files changed, 3 insertions, 3 deletions
diff --git a/it_html.class b/it_html.class
index 72507ed..be13fe4 100644
--- a/it_html.class
+++ b/it_html.class
@@ -483,7 +483,7 @@ function U(/* ... */)
# handle scheme, user (urlencoded), password, host
$hostpart =
- ($u['user'] ? preg_replace('|[^-\w.+!*(),:?@&=/~$%#]|e', 'urlencode(stripslashes("$0"))', $u['user'] . ($u['pass'] ? ":" . $u['pass'] : "") . "@") : "") .
+ ($u['user'] ? preg_replace('|[^-a-z0-9_.+!*(),:?@&=/~$%#]|ie', 'urlencode(stripslashes("$0"))', $u['user'] . ($u['pass'] ? ":" . $u['pass'] : "") . "@") : "") .
($u['host'] ? $u['host'] : "") .
($u['port'] ? ":" . intval($u['port']) : "");
@@ -497,8 +497,8 @@ function U(/* ... */)
$parts[$i] = (preg_match('/[0-9a-f][0-9a-f]/i', $parts[$i]) ? "%" : "%25") . $parts[$i];
$path = join("", $parts);
- $path = preg_replace('|[^-\w.+!*(),:?@&=/~$%#]|e', 'urlencode(stripslashes("$0"))', $path); # Single quotes are escaped with slash by preg_replace, remove it for urlencode
- $path = preg_replace('|^(\w+:)?//[^/]*$|', '$0/', $path); # Add slash if absolute url without a path, e.g. http://gna.ch
+ $path = preg_replace('|[^-a-z0-9_.+!*(),:?@&=/~$%#]|ie', 'urlencode(stripslashes("$0"))', $path); # Single quotes are escaped with slash by preg_replace, remove it for urlencode
+ $path = preg_replace('|^([a-z0-9_]+:)?//[^/]*$|', '$0/', $path); # Add slash if absolute url without a path, e.g. http://gna.ch
$queryparams = it_url::params($params);
$separator = strpos($path, "?") === false ? "?" : "&";