| @@ -1,6 +1,8 @@ | ||
| 1 | 1 | <?php |
| 2 | +defined('ABSPATH') || die('Restricted Access'); | |
| 2 | 3 | |
| 4 | +// utf8_encode is deprecated in PHP 8.2 | |
| 3 | 5 | function acym_utf8Encode(string $string): string |
| 4 | 6 | { |
| 5 | 7 | if (function_exists('mb_convert_encoding')) { |
| 6 | 8 | return mb_convert_encoding($string, 'UTF-8', 'ISO-8859-1'); |
| @@ -23,8 +25,9 @@ | ||
| 23 | 25 | return substr($string, 0, $j); |
| 24 | 26 | } |
| 25 | 27 | } |
| 26 | 28 | |
| 29 | +// utf8_decode is deprecated in PHP 8.2 | |
| 27 | 30 | function acym_utf8Decode(string $string): string |
| 28 | 31 | { |
| 29 | 32 | if (function_exists('mb_convert_encoding')) { |
| 30 | 33 | return mb_convert_encoding($string, 'ISO-8859-1', 'UTF-8'); |
| @@ -41,8 +44,9 @@ | ||
| 41 | 44 | break; |
| 42 | 45 | |
| 43 | 46 | case "\xF0": |
| 44 | 47 | ++$i; |
| 48 | + // no break | |
| 45 | 49 | |
| 46 | 50 | case "\xE0": |
| 47 | 51 | $newString[$j] = '?'; |
| 48 | 52 | $i += 2; |