From b91c04bfcf16f54fb505111f83dacbaef156b10e Mon Sep 17 00:00:00 2001 From: Mathias Date: Thu, 22 Sep 2022 14:29:51 +0200 Subject: [PATCH] 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 --- libs/sysplugins/smarty_cacheresource_keyvaluestore.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/sysplugins/smarty_cacheresource_keyvaluestore.php b/libs/sysplugins/smarty_cacheresource_keyvaluestore.php index 59bf1d4a..4b1c0f6d 100644 --- a/libs/sysplugins/smarty_cacheresource_keyvaluestore.php +++ b/libs/sysplugins/smarty_cacheresource_keyvaluestore.php @@ -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; }