Fix bug with php 5.2.4
This commit is contained in:
parent
7cb8809669
commit
e7982120df
@ -1840,6 +1840,16 @@ class TCPDF_FONTS {
|
|||||||
if ($isunicode) {
|
if ($isunicode) {
|
||||||
// requires PCRE unicode support turned on
|
// requires PCRE unicode support turned on
|
||||||
$chars = preg_split("//u", $str, -1, PREG_SPLIT_NO_EMPTY);
|
$chars = preg_split("//u", $str, -1, PREG_SPLIT_NO_EMPTY);
|
||||||
|
// DOL_CHANGE_LDR - FIX BUG WITH PHP 5.2.4
|
||||||
|
if (count(preg_split('//u', "\nx", -1, PREG_SPLIT_NO_EMPTY)) == 1) // If function preg_split is bugged
|
||||||
|
{
|
||||||
|
$tmp=array();
|
||||||
|
$len = mb_strlen($str, "UTF-8");
|
||||||
|
for ($i = 0; $i < $len; $i++) {
|
||||||
|
$tmp[] = mb_substr($str, $i, 1, "UTF-8");
|
||||||
|
}
|
||||||
|
$chars=$tmp;
|
||||||
|
}
|
||||||
$carr = array_map(array('self', 'uniord'), $chars);
|
$carr = array_map(array('self', 'uniord'), $chars);
|
||||||
} else {
|
} else {
|
||||||
$chars = str_split($str);
|
$chars = str_split($str);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user