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.
Tags
None
Referenced Files
Unknown Object (File)
Sun, May 12, 22:16
Unknown Object (File)
Wed, May 8, 11:23
Unknown Object (File)
Wed, May 8, 11:23
Unknown Object (File)
Wed, May 8, 10:11
Unknown Object (File)
Wed, May 8, 09:27
Unknown Object (File)
Sat, Apr 27, 11:06
Unknown Object (File)
Sat, Apr 27, 08:07
Unknown Object (File)
Sat, Apr 27, 02:49

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