summaryrefslogtreecommitdiff
path: root/it_html.class
diff options
context:
space:
mode:
Diffstat (limited to 'it_html.class')
-rw-r--r--it_html.class5
1 files changed, 1 insertions, 4 deletions
diff --git a/it_html.class b/it_html.class
index 02f3f2a..c7105b7 100644
--- a/it_html.class
+++ b/it_html.class
@@ -556,10 +556,7 @@ static function U(/* ... */)
$schemepart = $hostpart ? ($u['scheme'] ? $u['scheme'] . ":" : "") . "//$hostpart" : ($u['scheme'] == "mailto" ? $u['scheme'] . ":" : "");
# hack: encode % if not followed by two hex digits
- $parts = preg_split('/%([^%]{0,2})/', $u['path'], -1, PREG_SPLIT_DELIM_CAPTURE);
- for ($i = 1; $i < count($parts); $i+=2)
- $parts[$i] = (preg_match('/[0-9a-f][0-9a-f]/i', $parts[$i]) ? "%" : "%25") . $parts[$i];
- $path = join("", $parts);
+ $path = preg_replace('/%(?![0-9a-f]{2})/i', '%25', $u['path']);
# if params replace url parameters that are present in base, replace them but keep their order
foreach ($u['params'] as $key => $dummy)