Page MenuHomePhorge

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

Authored by aklapper on Jun 10 2023, 16:33.

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.

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.

Diff Detail

Repository
rP Phorge
Lint
Lint Not Applicable
Unit
Tests Not Applicable