Homestyx hydra
Diffusion hydra cb9fcf18d5c3

Fix PHP 8.1 "strlen(null)" exception trying to stop maintenance mode of…

Description

Fix PHP 8.1 "strlen(null)" exception trying to stop maintenance mode of Diffusion repo

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.

Use isset instead to check if the argument "start" was passed to the CLI command.

EXCEPTION: (RuntimeException) strlen(): Passing null to parameter #1 ($string) of type string is deprecated at [<arcanist>/src/error/PhutilErrorHandler.php:261]
arcanist(head=master, ref.master=97e163187418), phorge(head=repoMaintStartHistory, ref.master=1c098c273d06, ref.repoMaintStartHistory=0a4a34143528)
  #0 PhutilErrorHandler::handleError(integer, string, string, integer) called at [<phorge>/src/applications/repository/management/PhabricatorRepositoryManagementMaintenanceWorkflow.php:45]

Closes T15476

Test Plan: After applying this change, executing ./bin/repository maintenance --stop R1 on the CLI shows Took repository "R1" out of maintenance mode. as expected, instead of an exception.

Reviewers: O1 Blessed Committers, valerio.bozzolan, aklapper, avivey

Reviewed By: O1 Blessed Committers, valerio.bozzolan, avivey

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

Maniphest Tasks: T15476

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

Details

Provenance
Steve CampbellAuthored on Jul 17 2023, 9:39 AM
sirocylPushed on Oct 16 2024, 5:49 AM
Parents
R1:27fa49896622: Fix PHP 8.1 strlen(null) error in PhabricatorFile::newChunkedFile()
Branches
Unknown
Tags
Unknown

Event Timeline