Use native PHP preg_split instead of library (#7741)

The original library version was created to fix a bug that was from 2008. This bug has been fixed for a long time and the native tool improved.
This commit is contained in:
frytimo
2026-02-10 19:33:51 -04:00
committed by GitHub
parent 141a350a96
commit ed3311033c

View File

@@ -1998,7 +1998,7 @@ class TCPDF_FONTS {
public static function UTF8StringToArray($str, $isunicode, &$currentfont) {
if ($isunicode == true) {
// requires PCRE unicode support turned on
$chars = TCPDF_STATIC::pregSplit('//','u', $str, -1, PREG_SPLIT_NO_EMPTY);
$chars = preg_split('//u', $str, -1, PREG_SPLIT_NO_EMPTY);
$carr = array_map(array('TCPDF_FONTS', 'uniord'), $chars);
} else {
$chars = str_split($str);