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
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
F2940058: D25283.1738038003.diff
Mon, Jan 27, 04:20
F2935846: D25283.1737879256.diff
Sat, Jan 25, 08:14
F2935136: D25283.1737824652.diff
Fri, Jan 24, 17:04
F2931371: D25283.1737706087.diff
Thu, Jan 23, 08:08

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
Branch
diffusionImportNonExistingActivatedRepo (branched from master)
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 530
Build 530: arc lint + arc unit