Page MenuHomePhorge

Fix PHP 8.1 "strlen(null)" exception adding a Harbormaster Build Plan

Authored by aklapper on Aug 6 2023, 20:37.
Referenced Files
F357537: D25376.diff
Sat, Sep 23, 19:59
Unknown Object (File)
Thu, Sep 21, 06:45
Unknown Object (File)
Sun, Sep 3, 18:54
Unknown Object (File)
Fri, Sep 1, 10:33
Unknown Object (File)
Wed, Aug 30, 22:20
Unknown Object (File)
Tue, Aug 29, 23:10
Unknown Object (File)
Mon, Aug 28, 07:01
Unknown Object (File)
Sat, Aug 26, 00:46



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.

EXCEPTION: (RuntimeException) strlen(): Passing null to parameter #1 ($string) of type string is deprecated at [<arcanist>/src/error/PhutilErrorHandler.php:261]
arcanist(head=customOAuthUrlencodeNull, ref.master=788098096e11, ref.customOAuthUrlencodeNull=4f0f2043b7e9), phorge(head=master, ref.master=226f3150933d)
  #0 <#2> PhutilErrorHandler::handleError(integer, string, string, integer) called at [<phorge>/src/applications/harbormaster/editor/HarbormasterBuildPlanEditEngine.php:106]

Closes T15591

Test Plan

Visit /harbormaster/plan/edit/form/default/. "Create Build Plan" page renders as expected.

Diff Detail

rP Phorge
Lint Not Applicable
Tests Not Applicable

Event Timeline

aklapper requested review of this revision.Aug 6 2023, 20:37
This revision is now accepted and ready to land.Aug 7 2023, 03:12