Page MenuHomePhorge

Fix PHP 8.1 "strlen(null)" exception in PhabricatorStandardCustomFieldLink.php
ClosedPublic

Authored by aklapper on May 1 2024, 15:40.
Tags
None
Referenced Files
F3959193: D25610.1746500900.diff
Mon, May 5, 03:08
F3852252: D25610.1746123296.diff
Wed, Apr 30, 18:14
F3852251: D25610.1746123295.diff
Wed, Apr 30, 18:14
F3850616: D25610.1746114423.diff
Wed, Apr 30, 15:47
F3766870: D25610.1745847400.diff
Sun, Apr 27, 13:36
F3766869: D25610.1745847399.diff
Sun, Apr 27, 13:36
F3763085: D25610.1745838812.diff
Sun, Apr 27, 11:13
F3613171: D25610.1745300643.diff
Mon, Apr 21, 05:44

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 T15807

Test Plan

Unknown. Given that $value is later used to construct a phutil_tag I assume that it should be a string and not a scalar.

Diff Detail

Repository
rP Phorge
Lint
Lint Not Applicable
Unit
Tests Not Applicable