Fixed PHP8.1 deprecation errors passing null to parameter in trim (#807)

Fixed a PHP 8.1 deprecation error:  trim(): Passing null to parameter #1 ($string) of type string is deprecated in cacheresource_keyvaluestore.php on line 247 and in cacheresource_keyvaluestore.php on line 431
This commit is contained in:
Mathias
2022-09-22 14:29:51 +02:00
committed by GitHub
parent c53342c9fc
commit b91c04bfcf

View File

@@ -244,7 +244,7 @@ abstract class Smarty_CacheResource_KeyValueStore extends Smarty_CacheResource
*/
protected function sanitize($string)
{
$string = trim($string, '|');
$string = trim((string)$string, '|');
if (!$string) {
return '';
}
@@ -428,7 +428,7 @@ abstract class Smarty_CacheResource_KeyValueStore extends Smarty_CacheResource
$t[] = 'IVK#COMPILE' . $_compile;
}
$_name .= '#';
$cid = trim($cache_id, '|');
$cid = trim((string)$cache_id, '|');
if (!$cid) {
return $t;
}