diff options
author | Urban Müller | 2016-06-28 14:31:08 +0200 |
---|---|---|
committer | Urban Müller | 2016-06-28 14:31:08 +0200 |
commit | ae09401e2342ade5e505b6e1f553ad270e6ccdd6 (patch) | |
tree | 95534e581843be794105ab3cba853510051f305b /it_html.class | |
parent | a165bf3c9b399456b9e411825e298cff5940efea (diff) | |
download | itools-ae09401e2342ade5e505b6e1f553ad270e6ccdd6.tar.gz itools-ae09401e2342ade5e505b6e1f553ad270e6ccdd6.tar.bz2 itools-ae09401e2342ade5e505b6e1f553ad270e6ccdd6.zip |
code cleanup
Diffstat (limited to 'it_html.class')
-rw-r--r-- | it_html.class | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/it_html.class b/it_html.class index 3537707..7d3fba9 100644 --- a/it_html.class +++ b/it_html.class @@ -540,7 +540,6 @@ static function U(/* ... */) if (!($u = @parse_url($base))) list($u['path'], $u['query']) = explode("?", $base, 2); - $u['query'] = strtr($u['query'], array("?" => rawurlencode("?"))); $u['host'] = preg_match('/[^-_.0-9a-z]/i', $u['host']) && function_exists('idn_to_ascii') && ($idnahost = idn_to_ascii($GLOBALS['it_html']->p['charset'] == "iso-8859-1" ? utf8_encode($u['host']) : $u['host'])) ? $idnahost : $u['host']; # Punycode hostname to include into webpage $u['host'] = preg_replace_callback('/[^-_.0-9a-z\x80-\xff]/i', function($m) { return rawurlencode($m[0]); }, $u['host']); # Encode garbage chars in host @@ -553,7 +552,7 @@ static function U(/* ... */) $schemepart = $hostpart ? ($u['scheme'] ? $u['scheme'] . ":" : "") . "//$hostpart" : ($u['scheme'] == "mailto" ? $u['scheme'] . ":" : ""); - $path = $u['path'] . ($u['query'] ? "?" . $u['query'] : "") . ($u['fragment'] ? "#" . $u['fragment'] : ""); + $path = $u['path'] . ($u['query'] ? "?" . strtr($u['query'], array("?" => rawurlencode("?"))) : "") . ($u['fragment'] ? "#" . $u['fragment'] : ""); # hack: encode % if not followed by two hex digits $parts = preg_split('/%([^%]{0,2})/', $path, -1, PREG_SPLIT_DELIM_CAPTURE); |