From afff4daf8ca08ea35dfd4cc0aa380b4181a938b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean=20Charles=20Del=C3=A9pine?= Date: Thu, 5 Feb 2026 13:36:04 +0100 Subject: [PATCH 1/2] fix: Deprecated strlen(null) in Redis Hashtable on PHP 8.1+ ### Problem On PHP 8.1+, calling `strlen(null)` raises a deprecation warning in Redis Hashtable configuration when no password is set. ### Solution Replaced `strlen()` check with `!empty()` to ensure proper handling of null/empty passwords while preserving previous behavior. ### Compatibility - No change in functionality. - Tested on PHP 8.4 --- lib/Horde/Core/Factory/HashTable.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Horde/Core/Factory/HashTable.php b/lib/Horde/Core/Factory/HashTable.php index e68105ba..4f087c0a 100644 --- a/lib/Horde/Core/Factory/HashTable.php +++ b/lib/Horde/Core/Factory/HashTable.php @@ -66,7 +66,7 @@ public function create(Horde_Injector $injector) $redis_params = []; $common = array_filter([ - 'password' => strlen($params['password']) ? $params['password'] : null, + 'password' => !empty($params['password']) ? $params['password'] : null, 'persistent' => !empty($params['persistent']), 'database' => !empty($params['database']) ? $params['database'] : null, ]); From 6b19f20a74af3e280030012c6d03f37012b2a520 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean=20Charles=20Del=C3=A9pine?= Date: Mon, 23 Feb 2026 15:25:46 +0100 Subject: [PATCH 2/2] Update HashTable.php Address review: use null coalescing operator --- lib/Horde/Core/Factory/HashTable.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Horde/Core/Factory/HashTable.php b/lib/Horde/Core/Factory/HashTable.php index 4f087c0a..c1926c07 100644 --- a/lib/Horde/Core/Factory/HashTable.php +++ b/lib/Horde/Core/Factory/HashTable.php @@ -66,7 +66,7 @@ public function create(Horde_Injector $injector) $redis_params = []; $common = array_filter([ - 'password' => !empty($params['password']) ? $params['password'] : null, + 'password' => $params['password'] ?? null, 'persistent' => !empty($params['persistent']), 'database' => !empty($params['database']) ? $params['database'] : null, ]);