summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Schneider2010-06-02 11:49:41 +0000
committerChristian Schneider2010-06-02 11:49:41 +0000
commitaa3529d9a5d81d83b7bf82a33e4e8988ac81a420 (patch)
treed9cb9e0affeabb631c40a0fdba14e3af929242fb
parent5192a82648c584fb946cea62cc14607cc3891b1e (diff)
downloaditools-aa3529d9a5d81d83b7bf82a33e4e8988ac81a420.tar.gz
itools-aa3529d9a5d81d83b7bf82a33e4e8988ac81a420.tar.bz2
itools-aa3529d9a5d81d83b7bf82a33e4e8988ac81a420.zip
Use a-z0-9_ instead of w character class because because it is locale aware
-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 ? "?" : "&";