Page MenuHomePhorge

Fix PHP 8.1 "strlen(null)" exception rendering files/documents

Authored by aklapper on Mon, May 13, 17:49.
Referenced Files
F2199881: D25638.1716507937.diff
Wed, May 22, 23:45
F2199880: D25638.1716507936.diff
Wed, May 22, 23:45
F2199738: D25638.1716503889.diff
Wed, May 22, 22:38
F2199627: D25638.1716501075.diff
Wed, May 22, 21:51
Unknown Object (File)
Tue, May 21, 16:41
Unknown Object (File)
Tue, May 21, 16:34
Unknown Object (File)
Mon, May 20, 20:21
Unknown Object (File)
Mon, May 20, 14:58



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.

ERROR 8192: strlen(): Passing null to parameter #1 ($string) of type string is deprecated at [/var/www/html/phorge/phorge/src/applications/files/document/render/PhabricatorDocumentRenderingEngine.php:211]

Closes T15826

Test Plan

Surf a Diffusion repository and play with View Options.

Diff Detail

rP Phorge
Lint Not Applicable
Tests Not Applicable