Skip to content

Commit

Permalink
Fix for php 8.0 (#687)
Browse files Browse the repository at this point in the history
* Fix PHP 8.0
$parts must be an array, because the argument for count() must be countable, mb_split() returns an array or a boolean.
  • Loading branch information
pandarek committed Dec 3, 2021
1 parent cb5efd0 commit cd96228
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libs/plugins/shared.mb_str_replace.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function smarty_mb_str_replace($search, $replace, $subject, &$count = 0)
}
}
} else {
$parts = mb_split(preg_quote($search), $subject);
$parts = mb_split(preg_quote($search), $subject) ?: array();
$count = count($parts) - 1;
$subject = implode($replace, $parts);
}
Expand Down

0 comments on commit cd96228

Please sign in to comment.