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
Differential D25180
Do not pass a null string to mb_convert_case() for PHP 8.1 compatibility aklapper on May 3 2023, 14:08. Authored by
Details Passing null to the $string parameter of mb_convert_case() is deprecated in PHP 8.1. Closes part of T15335 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.
Diff Detail
Event TimelineComment Actions I'm afraid this change should also be applied to a bunch of similar functions in that file? Comment Actions Thanks for this patch Since this is a low-level function probably it would be nice an if($str === null) { return ''; } short circuit instead If you do not have an exception for other functions, I would say to skip this at the moment Comment Actions Thanks just to clarify: does it still fix your problem? (I think yes but there is honestly a possibility that an object is passed, then casted internally to string by mb_convert_case(), but returning a null. I really do not want to test this corner-case. I just want to say that if this still crashes, it's probably because of that.) Comment Actions Premising that it would be nice to discover who is calling phutil_utf8_strtolower(null) ignoring the PHPDoc, and premising that if some people has more time to further improve the situation any follow-up patch is welcome, I tested this locally without any nuclear implosion, And, this is the very minimal change to short-circuit out this problem introduced by PHP 8.1 deprecation So, thanks for this! |