mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-01 17:04:26 +02:00
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:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user