Page MenuHomePhorge

Fix PHP 8.1 "strlen(null)" exceptions which block rendering the DarkConsole
ClosedPublic

Authored by valerio.bozzolan on May 1 2023, 14:21.
Tags
None
Referenced Files
F3224927: D25165.1742089690.diff
Sat, Mar 15, 01:48
F3220686: D25165.1741813023.diff
Tue, Mar 11, 20:57
F3212640: D25165.1741454896.diff
Fri, Mar 7, 17:28
F3001284: D25165.1740441510.diff
Sun, Feb 23, 23:58
F3001283: D25165.1740441510.diff
Sun, Feb 23, 23:58
F2988380: D25165.1740150046.diff
Feb 20 2025, 15:00
F2983588: D25165.1739992067.diff
Feb 18 2025, 19:07
F2979598: D25165.1739867782.diff
Feb 17 2025, 08:36

Details

Summary

Since PHP 8.1 the function call strlen(null) is deprecated.

Since Phabricator/Phorge elevates deprecation warnings to exceptions, the
specific fix implies dealing with null, and dealing with real strings.

In the specific case, a simple cast was made to deal with real strings.

Closes T15315

Test Plan

Visit the Home Page with DarkConsole enabled in your configuration: no crashes

Diff Detail

Repository
rP Phorge
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Putting in CC @aklapper so we don't do both this specific fix

src/applications/console/core/DarkConsoleCore.php
127–129

Note that this comment from Evan somehow supports the above line:

https://secure.phabricator.com/T13588#257338

This revision is now accepted and ready to land.May 20 2023, 17:12