From aa3529d9a5d81d83b7bf82a33e4e8988ac81a420 Mon Sep 17 00:00:00 2001 From: Christian Schneider Date: Wed, 2 Jun 2010 11:49:41 +0000 Subject: Use a-z0-9_ instead of w character class because because it is locale aware --- it_html.class | 6 +++--- 1 file 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 ? "?" : "&"; -- cgit v1.2.3