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
F2983553: D25283.1739992028.diff
Tue, Feb 18, 19:07
F2982830: D25283.1739971949.diff
Tue, Feb 18, 13:32
F2971296: D25283.1739539502.diff
Thu, Feb 13, 13:25
F2970923: D25283.1739533688.diff
Thu, Feb 13, 11:48
F2948423: D25283.1738558026.diff
Sun, Feb 2, 04:47
F2940189: D25283.1738041339.diff
Mon, Jan 27, 05:15
F2940184: D25283.1738041335.diff
Mon, Jan 27, 05:15
F2940134: D25283.1738040724.diff
Mon, Jan 27, 05:05

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