From 55bd4e0052b830256ad1d1134bbe5c7231d1427b Mon Sep 17 00:00:00 2001 From: Christian Schneider Date: Mon, 12 Dec 2022 16:55:47 +0100 Subject: Add and use it::utf8_decode and it::utf8_encode for easier migration to PHP 8.2 --- it_html.class | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'it_html.class') 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 -- cgit v1.2.3