From 47b025afa7dbec94587c126b34dbd54a595a9ca5 Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Wed, 25 May 2022 14:07:34 +0200 Subject: [PATCH] Fix strlower'ing null Signed-off-by: Christoph Wurst --- lib/Horde/String.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/Horde/String.php b/lib/Horde/String.php index d2797bf..ff4f00a 100644 --- a/lib/Horde/String.php +++ b/lib/Horde/String.php @@ -199,7 +199,11 @@ public static function lower($string, $locale = false, $charset = null) if (!isset(self::$_lowers[$string])) { $language = setlocale(LC_CTYPE, 0); setlocale(LC_CTYPE, 'C'); - self::$_lowers[$string] = strtolower($string); + if ($string === null) { + self::$_lowers[$string] = ''; + } else { + self::$_lowers[$string] = strtolower($string); + } setlocale(LC_CTYPE, $language); }