mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-03 18:04:26 +02:00
Fix for php 8.0 (#687)
* 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.
This commit is contained in:
committed by
GitHub
parent
cb5efd04c3
commit
cd962280ce
@@ -44,7 +44,7 @@ if (!function_exists('smarty_mb_str_replace')) {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$parts = mb_split(preg_quote($search), $subject);
|
||||
$parts = mb_split(preg_quote($search), $subject) ?: array();
|
||||
$count = count($parts) - 1;
|
||||
$subject = implode($replace, $parts);
|
||||
}
|
||||
|
Reference in New Issue
Block a user