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
Unknown Object (File)
Wed, Apr 17, 21:50
Unknown Object (File)
Wed, Apr 17, 06:07
Unknown Object (File)
Sun, Apr 14, 15:48
Unknown Object (File)
Sun, Apr 14, 15:45
Unknown Object (File)
Sun, Apr 14, 15:07
Unknown Object (File)
Sun, Apr 14, 14:31
Unknown Object (File)
Sun, Apr 14, 13:57
Unknown Object (File)
Thu, Apr 11, 16:14

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