@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

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

Reviewers: O1 Blessed Committers, avivey

Reviewed By: O1 Blessed Committers, avivey

Subscribers: aklapper, speck, tobiaswiese, Matthew, Cigaryno

Maniphest Tasks: T15315

Differential Revision: https://we.phorge.it/D25165

+3
+3
src/applications/console/core/DarkConsoleCore.php
··· 124 124 } else if (is_resource($data)) { 125 125 return '<resource>'; 126 126 } else { 127 + // This is very probably not a string in strict sense 128 + $data = phutil_string_cast($data); 129 + 127 130 // Truncate huge strings. Since the data doesn't really matter much, 128 131 // just truncate bytes to avoid PhutilUTF8StringTruncator overhead. 129 132 $length = strlen($data);