summaryrefslogtreecommitdiff
path: root/it_html.class
diff options
context:
space:
mode:
authorUrban Müller2009-12-10 14:25:22 +0000
committerUrban Müller2009-12-10 14:25:22 +0000
commit03d36e13aacddb6b1ece2931fb283e4c4c277ccb (patch)
treed0a7314e66db0ebe3b350ef86b6978eae0934bef /it_html.class
parent6ab302fc5375bad7e3fa197245f230cce00df694 (diff)
downloaditools-03d36e13aacddb6b1ece2931fb283e4c4c277ccb.tar.gz
itools-03d36e13aacddb6b1ece2931fb283e4c4c277ccb.tar.bz2
itools-03d36e13aacddb6b1ece2931fb283e4c4c277ccb.zip
Encode garbage chars in host
Diffstat (limited to 'it_html.class')
-rw-r--r--it_html.class1
1 files changed, 1 insertions, 0 deletions
diff --git a/it_html.class b/it_html.class
index f633be3..46a4333 100644
--- a/it_html.class
+++ b/it_html.class
@@ -448,6 +448,7 @@ function U(/* ... */)
list($u['path'], $u['query']) = explode("?", $base, 2);
$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('/[^-_.0-9a-z\x80-\xff]/ie', "rawurlencode('\$0')", $u['host']); # Encode garbage chars in host
# handle scheme, user, password, host
$hostpart =