1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-22 06:42:41 +01:00

Do not pass a null string to mb_convert_case() for PHP 8.1 compatibility

Summary:
Passing `null` to the `$string` parameter of `mb_convert_case()` is deprecated in PHP 8.1.
This is one of the exceptions which block rendering the "Browse Projects" overlay dialog.

Closes part of T15335

Test Plan: Applied this change in Arcanist (plus the four changes in D25179 in Phorge) and the `Browse Projects` overlay dialog finally rendered in web browser and listed existing projects.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T15335

Differential Revision: https://we.phorge.it/D25180
This commit is contained in:
Andre Klapper 2023-05-04 12:38:47 +02:00
parent 084303cd5f
commit f7d5614ca1

View file

@ -789,6 +789,9 @@ function phutil_utf8_ucwords($str) {
* @phutil-external-symbol function mb_convert_case * @phutil-external-symbol function mb_convert_case
*/ */
function phutil_utf8_strtolower($str) { function phutil_utf8_strtolower($str) {
if ($str === null) {
return '';
}
if (function_exists('mb_convert_case')) { if (function_exists('mb_convert_case')) {
return mb_convert_case($str, MB_CASE_LOWER, 'UTF-8'); return mb_convert_case($str, MB_CASE_LOWER, 'UTF-8');
} }