Page MenuHomePhorge

D25180.1740001910.diff
No OneTemporary

D25180.1740001910.diff

diff --git a/src/utils/utf8.php b/src/utils/utf8.php
--- a/src/utils/utf8.php
+++ b/src/utils/utf8.php
@@ -789,18 +789,22 @@
* @phutil-external-symbol function mb_convert_case
*/
function phutil_utf8_strtolower($str) {
- if (function_exists('mb_convert_case')) {
- return mb_convert_case($str, MB_CASE_LOWER, 'UTF-8');
- }
+ if (phutil_nonempty_stringlike($str)) {
+ if (function_exists('mb_convert_case')) {
+ return mb_convert_case($str, MB_CASE_LOWER, 'UTF-8');
+ }
- static $map;
- if ($map === null) {
- $map = array_combine(
- range('A', 'Z'),
- range('a', 'z'));
- }
+ static $map;
+ if ($map === null) {
+ $map = array_combine(
+ range('A', 'Z'),
+ range('a', 'z'));
+ }
- return phutil_utf8_strtr($str, $map);
+ return phutil_utf8_strtr($str, $map);
+ } else {
+ return '';
+ }
}

File Metadata

Mime Type
text/plain
Expires
Wed, Feb 19, 21:51 (2 d, 6 m ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1138167
Default Alt Text
D25180.1740001910.diff (874 B)

Event Timeline