Page MenuHomePhorge

Fix PHP 8.1 "strlen(null)" exception adding an External Build Systems build step in Harbormaster
AbandonedPublic

Authored by aklapper on Aug 6 2023, 20:55.

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=DrydockRunCommand, ref.master=226f3150933d, ref.DrydockRunCommand=2ad42e7a296b)
  #0 <#2> PhutilErrorHandler::handleError(integer, string, string, integer) called at [<phorge>/src/applications/passphrase/view/PassphraseCredentialControl.php:53]

Closes T15593

Test Plan

Add a build step in Harbormaster, select "Interacting with External Build Systems > Build with Buildkite". Ppage "New Step: Build with Buildkite" at /harbormaster/step/new/1/HarbormasterBuildkiteBuildStepImplementation/ correctly renders.

Diff Detail

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

Event Timeline

aklapper requested review of this revision.Aug 6 2023, 20:55
aklapper retitled this revision from Fix PHP 8.1 "strlen(null)" exception adding a "Drydock: Run Command" build step in Harbormaster to Fix PHP 8.1 "strlen(null)" exception adding an External Build Systems build step in Harbormaster.Aug 6 2023, 21:13
This revision is now accepted and ready to land.Aug 7 2023, 03:12

I finally managed to lost track: This got already fixed in D25370.