From f7d5614ca11c3b239fd5dd05c65e0af07c95c954 Mon Sep 17 00:00:00 2001 From: Andre Klapper Date: Thu, 4 May 2023 12:38:47 +0200 Subject: [PATCH] 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 --- src/utils/utf8.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/utils/utf8.php b/src/utils/utf8.php index 64711eea..52d147e6 100644 --- a/src/utils/utf8.php +++ b/src/utils/utf8.php @@ -789,6 +789,9 @@ function phutil_utf8_ucwords($str) { * @phutil-external-symbol function mb_convert_case */ function phutil_utf8_strtolower($str) { + if ($str === null) { + return ''; + } if (function_exists('mb_convert_case')) { return mb_convert_case($str, MB_CASE_LOWER, 'UTF-8'); }