@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)" and "explode()" exceptions which block rendering Administrator Account Creation page

Summary:
`strlen()` was used in Phabricator to check if a generic value is a non-empty string.
This behavior is deprecated since PHP 8.1. Phorge adopts `phutil_nonempty_string()` as a replacement.

Note: this may highlight other absurd input values that might be worth correcting
instead of just ignoring. If phutil_nonempty_string() throws an exception in your
instance, report it to Phorge to evaluate and fix that specific corner case.

Similarly, `explode(string $separator, string $string, int $limit)` does not accept
passing null instead of an actual string as input parameter either anymore.

Closes T15284

Test Plan: Applied these two changes. Afterwards, admin user account was created and Phorge homepage rendered in web browser on a fresh installation.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T15284

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

+4 -1
+1 -1
src/applications/auth/constants/PhabricatorCookies.php
··· 164 164 // Old cookies look like: /uri 165 165 // New cookies look like: timestamp,/uri 166 166 167 - if (!strlen($cookie)) { 167 + if (!phutil_nonempty_string($cookie)) { 168 168 return null; 169 169 } 170 170
+3
src/applications/people/cache/PhabricatorUserProfileImageCacheType.php
··· 91 91 } 92 92 93 93 public function isRawCacheDataValid(PhabricatorUser $user, $key, $data) { 94 + if ($data === null) { 95 + return false; 96 + } 94 97 $parts = explode(',', $data, 2); 95 98 $version = reset($parts); 96 99 return ($version === $this->getCacheVersion($user));