Page MenuHomePhorge

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

Authored by aklapper on Aug 6 2023, 20:37.
Tags
None
Referenced Files
F2942935: D25376.1738147707.diff
Tue, Jan 28, 10:48
F2935171: D25376.1737829351.diff
Fri, Jan 24, 18:22
F2933528: D25376.1737773832.diff
Fri, Jan 24, 02:57
F2929623: D25376.1737661614.diff
Wed, Jan 22, 19:46
F2913837: D25376.1737431982.diff
Mon, Jan 20, 03:59
F2913836: D25376.1737431980.diff
Mon, Jan 20, 03:59
F2908462: D25376.1737378932.diff
Sun, Jan 19, 13:15
F2904973: D25376.1737337894.diff
Sun, Jan 19, 01:51

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.

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

Repository
rP Phorge
Branch
HarbormasterBuildPlan (branched from master)
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 730
Build 730: arc lint + arc unit

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