Page MenuHomePhorge

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

Authored by aklapper on May 1 2024, 15:48.
Tags
None
Referenced Files
F3890397: D25611.1746266948.diff
Fri, May 2, 10:09
F3852253: D25611.1746123297.diff
Wed, Apr 30, 18:14
F3850618: D25611.1746114425.diff
Wed, Apr 30, 15:47
F3850617: D25611.1746114424.diff
Wed, Apr 30, 15:47
F3766871: D25611.1745847402.diff
Sun, Apr 27, 13:36
F3763096: D25611.1745838831.diff
Sun, Apr 27, 11:13
F3763090: D25611.1745838821.diff
Sun, Apr 27, 11:13
F3720106: D25611.1745696051.diff
Fri, Apr 25, 19:34

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 T15808

Test Plan

Unknown. Given that the function rendering $value is later called to construct a title string passed to pht() 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