Page MenuHomePhorge

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

Authored by aklapper on Fri, May 12, 21:45.
Referenced Files
Unknown Object (File)
Wed, May 31, 06:44
Unknown Object (File)
Wed, May 31, 02:00
Unknown Object (File)
Mon, May 29, 20:22
Unknown Object (File)
Mon, May 29, 12:59
Unknown Object (File)
Fri, May 26, 15:30
Unknown Object (File)
Mon, May 15, 00:19



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

Diff Detail

rP Phorge
Lint Not Applicable
Tests Not Applicable

Event Timeline

Thanks for this patch (again)!

I tested this locally, logging stuff with phlog() following the test plan (that I will edit), and I can confirm that the $query_key is just a string, or null, and should really be nothing else since getURIData() just should return a string or null.

Any other type will be reported by phutil_nonempty_string() and that is very OK here.


This revision is now accepted and ready to land.Fri, May 19, 19:06