mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-02 17:34: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)
|
protected function sanitize($string)
|
||||||
{
|
{
|
||||||
$string = trim($string, '|');
|
$string = trim((string)$string, '|');
|
||||||
if (!$string) {
|
if (!$string) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
@@ -428,7 +428,7 @@ abstract class Smarty_CacheResource_KeyValueStore extends Smarty_CacheResource
|
|||||||
$t[] = 'IVK#COMPILE' . $_compile;
|
$t[] = 'IVK#COMPILE' . $_compile;
|
||||||
}
|
}
|
||||||
$_name .= '#';
|
$_name .= '#';
|
||||||
$cid = trim($cache_id, '|');
|
$cid = trim((string)$cache_id, '|');
|
||||||
if (!$cid) {
|
if (!$cid) {
|
||||||
return $t;
|
return $t;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user