From bff0f810a7d887c754201e1d7270d88c4802cf6b Mon Sep 17 00:00:00 2001 From: Andre Klapper Date: Sat, 20 May 2023 11:46:21 +0200 Subject: [PATCH] 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 --- src/applications/transactions/bulk/PhabricatorBulkEngine.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/applications/transactions/bulk/PhabricatorBulkEngine.php b/src/applications/transactions/bulk/PhabricatorBulkEngine.php index 0091321245..e2d2c02a29 100644 --- a/src/applications/transactions/bulk/PhabricatorBulkEngine.php +++ b/src/applications/transactions/bulk/PhabricatorBulkEngine.php @@ -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 {