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
F3880067: D25165.1746235732.diff
Fri, May 2, 01:28
F3877060: D25165.1746199232.diff
Thu, May 1, 15:20
F3852328: D25165.1746123728.diff
Wed, Apr 30, 18:22
F3852327: D25165.1746123727.diff
Wed, Apr 30, 18:22
F3823754: D25165.1746023584.diff
Tue, Apr 29, 14:33
F3777033: D25165.1745870946.diff
Sun, Apr 27, 20:09
F3763512: D25165.1745839308.diff
Sun, Apr 27, 11:21
F3763510: D25165.1745839307.diff
Sun, Apr 27, 11:21

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