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
F2945599: D25165.1738334364.diff
Thu, Jan 30, 14:39
F2944236: D25165.1738257462.diff
Wed, Jan 29, 17:17
F2932803: D25165.1737743911.diff
Thu, Jan 23, 18:38
F2931635: D25165.1737719254.diff
Thu, Jan 23, 11:47
F2931632: D25165.1737719224.diff
Thu, Jan 23, 11:47
F2931630: D25165.1737719124.diff
Thu, Jan 23, 11:45
F2931288: D25165.1737702360.diff
Thu, Jan 23, 07:06
F2913106: D25165.1737423515.diff
Mon, Jan 20, 01:38

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
Branch
php81-darkconsole
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 318
Build 318: arc lint + arc unit

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