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
F2988380: D25165.1740150046.diff
Thu, Feb 20, 15:00
F2983588: D25165.1739992067.diff
Tue, Feb 18, 19:07
F2979598: D25165.1739867782.diff
Mon, Feb 17, 08:36
F2977067: D25165.1739606815.diff
Fri, Feb 14, 08:06
F2961824: D25165.1739170314.diff
Sun, Feb 9, 06:51
F2961823: D25165.1739170310.diff
Sun, Feb 9, 06:51
F2961822: D25165.1739170304.diff
Sun, Feb 9, 06:51
F2961103: D25165.1739160755.diff
Sun, Feb 9, 04:12

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