diff options
author | Christian Schneider | 2009-12-04 12:44:34 +0000 |
---|---|---|
committer | Christian Schneider | 2009-12-04 12:44:34 +0000 |
commit | 8913e9eb903fd747512294f4b6c66551dae26658 (patch) | |
tree | 11a2b0034b66056346ebfc37f8020d1ced99a855 /it_html.class | |
parent | 93656aabcdb925fb14795f342e209bca59538f24 (diff) | |
download | itools-8913e9eb903fd747512294f4b6c66551dae26658.tar.gz itools-8913e9eb903fd747512294f4b6c66551dae26658.tar.bz2 itools-8913e9eb903fd747512294f4b6c66551dae26658.zip |
Convert IDNA domain names to Punycode in U()
Diffstat (limited to 'it_html.class')
-rw-r--r-- | it_html.class | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/it_html.class b/it_html.class index f87f740..f633be3 100644 --- a/it_html.class +++ b/it_html.class @@ -447,6 +447,8 @@ function U(/* ... */) if (!($u = @parse_url($base))) 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 + # handle scheme, user, password, host $hostpart = ($u['user'] ? $u['user'] . ($u['pass'] ? ":" . $u['pass'] : "") . "@" : "") . |