HomePhorge

Fix PHP 8.1 "strlen(null)" exception initializing Diffusion repository without…

Description

Fix PHP 8.1 "strlen(null)" exception initializing Diffusion repository without path access permissions

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.

Closes T15459

Test Plan: After applying this change, going to /diffusion/17/manage/, the actual error (cannot mkdir /var/repo/17: Permission denied) is propagated and displayed in the "Working Copy Status" section, instead of being hidden by a strlen() exception. See T15459 for details.

Reviewers: O1 Blessed Committers, speck

Reviewed By: O1 Blessed Committers, speck

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

Maniphest Tasks: T15459

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

Details

Provenance
Andre KlapperAuthored on Jun 10 2023, 1:59 PM
themackabuPushed on Mar 25 2025, 8:07 PM
Parents
rPc553692d452b: Fix PHP 8.1 "strlen(null)" exception which blocks rendering errors on Create…
Branches
Unknown
Tags
Unknown

Event Timeline