Page MenuHomePhorge

Fix PHP 8.1 "strlen(null)" exception which blocks dragging a task to a Workboard Column
ClosedPublic

Authored by aklapper on May 9 2023, 13:31.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Apr 16, 07:49
Unknown Object (File)
Sat, Apr 13, 21:23
Unknown Object (File)
Sat, Apr 13, 20:49
Unknown Object (File)
Thu, Apr 11, 09:42
Unknown Object (File)
Thu, Apr 11, 08:16
Unknown Object (File)
Thu, Apr 11, 05:58
Unknown Object (File)
Thu, Apr 11, 02:12
Unknown Object (File)
Mon, Apr 1, 01:36

Details

Summary

On a Workboard without any "Group by <something>", when moving a Task from a Column
to another, in PHP 8.1 there was a crash caused by a null passed to strlen().

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 T15373

Test Plan

Applied this change and afterwards dragging a Task card to another Column succeeded,
with or without a "Group by <something>" query.

Diff Detail

Repository
rP Phorge
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

aklapper requested review of this revision.May 9 2023, 13:31

Tested locally, with and without "Group By <something>"

Hoping to be useful I expand the test plan, and I add a small inline documentation

Thanks again

sgtm

src/applications/project/controller/PhabricatorProjectMoveController.php
31

✅ I verified that the above line is just null or a string

The function phutil_nonempty_string() will report any alien type, and that is OK.

This revision is now accepted and ready to land.May 9 2023, 16:29

add minor inline documentation

valerio.bozzolan retitled this revision from Fix PHP 8.1 "strlen(null)" exception which blocks dragging a task to a workboard column to Fix PHP 8.1 "strlen(null)" exception which blocks dragging a task to a Workboard Column.May 9 2023, 16:37
valerio.bozzolan edited the summary of this revision. (Show Details)
valerio.bozzolan edited the test plan for this revision. (Show Details)
This revision was landed with ongoing or failed builds.May 9 2023, 16:37
This revision was automatically updated to reflect the committed changes.

WHOA I hijacked your description just one millisecond before your land it seems