HomePhorge

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

Description

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

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/

Reviewers: O1 Blessed Committers, Matthew

Reviewed By: O1 Blessed Committers, Matthew

Subscribers: speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T15592

Differential Revision: https://we.phorge.it/D25377

Details

Provenance
Andre KlapperAuthored on Aug 11 2023, 12:01 PM
themackabuPushed on Mar 25 2025, 8:07 PM
Parents
rPc61c6a1ec3c1: Fix PHP 8.1 "strlen(null)" exception adding a Harbormaster Build Plan
Branches
Unknown
Tags
Unknown

Event Timeline