Skip to content

Commit e3d45a6

Browse files
committed
Ensure return type is always array
1 parent 8872a9c commit e3d45a6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

include/tcpdf_static.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1776,7 +1776,11 @@ public static function pregSplit($pattern, $modifiers, $subject, $limit=NULL, $f
17761776
$flags = $flags === null ? 0 : $flags;
17771777
// the bug only happens on PHP 5.2 when using the u modifier
17781778
if ((strpos($modifiers, 'u') === FALSE) OR (count(preg_split('//u', "\n\t", -1, PREG_SPLIT_NO_EMPTY)) == 2)) {
1779-
return preg_split($pattern.$modifiers, $subject, $limit, $flags);
1779+
$ret = preg_split($pattern.$modifiers, $subject, $limit, $flags);
1780+
if $ret === false {
1781+
return array();
1782+
}
1783+
return $ret;
17801784
}
17811785
// preg_split is bugged - try alternative solution
17821786
$ret = array();

0 commit comments

Comments
 (0)