Skip to content

Commit

Permalink
Merge pull request #9 from ChristophWurst/fix/lower-null-horde
Browse files Browse the repository at this point in the history
Fix strlower'ing null
  • Loading branch information
mrubinsk committed Jun 18, 2022
2 parents 8bfb181 + 47b025a commit 498dc09
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/Horde/String.php
Expand Up @@ -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);
}

Expand Down

0 comments on commit 498dc09

Please sign in to comment.