Page MenuHomePhorge

Fix PHP 8.1 "strlen(null)" exception adding a "Drydock: Run Command" build step in Harbormaster
ClosedPublic

Authored by aklapper on Aug 6 2023, 20:47.
Tags
None
Referenced Files
F3283919: D25377.1742762162.diff
Sat, Mar 22, 20:36
F3253364: D25377.1742427264.diff
Tue, Mar 18, 23:34
F3248680: D25377.1742266042.diff
Mon, Mar 17, 02:47
F3248666: D25377.1742265588.diff
Mon, Mar 17, 02:39
F3248627: D25377.1742264570.diff
Mon, Mar 17, 02:22
F3248476: D25377.1742258356.diff
Mon, Mar 17, 00:39
F3248421: D25377.1742256223.diff
Mon, Mar 17, 00:03
F3225049: D25377.1742090299.diff
Sat, Mar 15, 01:58

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/controller/HarbormasterStepEditController.php:142]

Closes T15592

Test Plan

Add a build step for an existing Harbormaster Build Plan, see that page New Step: Drydock: Run Command is correctly rendered at /harbormaster/step/new/1/HarbormasterDrydockCommandBuildStepImplementation/

Diff Detail

Repository
rP Phorge
Lint
Lint Not Applicable
Unit
Tests Not Applicable