Page MenuHomePhorge

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

Authored by aklapper on May 12 2023, 21:45.
Tags
None
Referenced Files
F2144717: D25223.id730.diff
Tue, Apr 16, 09:33
Unknown Object (File)
Thu, Apr 11, 13:56
Unknown Object (File)
Thu, Apr 11, 11:40
Unknown Object (File)
Thu, Apr 11, 00:53
Unknown Object (File)
Sat, Apr 6, 23:20
Unknown Object (File)
Mon, Apr 1, 01:40
Unknown Object (File)
Mon, Apr 1, 01:40
Unknown Object (File)
Mon, Apr 1, 01:40

Details

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

Diff Detail

Repository
rP Phorge
Lint
Lint Not Applicable
Unit
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.

sgtm

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