summaryrefslogtreecommitdiff
path: root/it_html.class
diff options
context:
space:
mode:
authorChristian Schneider2022-12-12 16:55:47 +0100
committerChristian Schneider2022-12-12 16:55:47 +0100
commit55bd4e0052b830256ad1d1134bbe5c7231d1427b (patch)
tree49d4980bb599db87085b75c7780dc6138ad681db /it_html.class
parentd6f07d7e1350c57e59192ba0047a8431fc59cdf3 (diff)
downloaditools-55bd4e0052b830256ad1d1134bbe5c7231d1427b.tar.gz
itools-55bd4e0052b830256ad1d1134bbe5c7231d1427b.tar.bz2
itools-55bd4e0052b830256ad1d1134bbe5c7231d1427b.zip
Add and use it::utf8_decode and it::utf8_encode for easier migration to PHP 8.2
Diffstat (limited to 'it_html.class')
-rw-r--r--it_html.class2
1 files changed, 1 insertions, 1 deletions
diff --git a/it_html.class b/it_html.class
index 8254c22..93057bd 100644
--- a/it_html.class
+++ b/it_html.class
@@ -511,7 +511,7 @@ static function U(...$args)
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_match('/[^-_.0-9a-z]/i', $u['host']) && function_exists('idn_to_ascii') && ($idnahost = idn_to_ascii($GLOBALS['it_html']->p['charset'] == "iso-8859-1" ? it::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
# handle scheme, user (urlencoded), password, host