Skip to content

Commit

Permalink
Ensure return type is always array
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolaasuni committed Dec 17, 2022
1 parent 8872a9c commit e3d45a6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion include/tcpdf_static.php
Original file line number Diff line number Diff line change
Expand Up @@ -1776,7 +1776,11 @@ public static function pregSplit($pattern, $modifiers, $subject, $limit=NULL, $f
$flags = $flags === null ? 0 : $flags;
// the bug only happens on PHP 5.2 when using the u modifier
if ((strpos($modifiers, 'u') === FALSE) OR (count(preg_split('//u', "\n\t", -1, PREG_SPLIT_NO_EMPTY)) == 2)) {
return preg_split($pattern.$modifiers, $subject, $limit, $flags);
$ret = preg_split($pattern.$modifiers, $subject, $limit, $flags);
if $ret === false {
return array();
}
return $ret;
}
// preg_split is bugged - try alternative solution
$ret = array();
Expand Down

0 comments on commit e3d45a6

Please sign in to comment.