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

Fix PHP 8.1 "strlen(null)" exception which blocks task Bulk Editor page

Summary:
`strlen()` was used in Phabricator to check if a generic value is a non-empty string.
This behavior is deprecated since PHP 8.1. Phorge adopts `phutil_nonempty_string()` as a replacement.

Note: this may highlight other absurd input values that might be worth correcting
instead of just ignoring. If phutil_nonempty_string() throws an exception in your
instance, report it to Phorge to evaluate and fix that specific corner case.

Closes T15391

Test Plan:
Applied this change and afterwards, "Bulk Editor" page on `/maniphest/bulk/` rendered correctly.

To test that:

- visit a list of some Tasks (like `/maniphest/`)
- filter something (this can be done in multiple ways)
- select Tasks
- click on Bulk Edit Selected Tasks

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

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

Maniphest Tasks: T15391

Differential Revision: https://we.phorge.it/D25223
This commit is contained in:
Andre Klapper 2023-05-20 11:46:21 +02:00
parent 44f2010a0b
commit bff0f810a7

View file

@ -153,7 +153,7 @@ abstract class PhabricatorBulkEngine extends Phobject {
->setViewer($viewer);
$query_key = $request->getURIData('queryKey');
if (strlen($query_key)) {
if (phutil_nonempty_string($query_key)) {
if ($search_engine->isBuiltinQuery($query_key)) {
$saved = $search_engine->buildSavedQueryFromBuiltin($query_key);
} else {