@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 Browse Repositories overlay dialog

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.

Closes T15420

Test Plan: Applied these two changes; afterwards "Browse Repositories" overlay dialog gets rendered in web browser and lists existing repositories.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

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

Maniphest Tasks: T15420

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

+2 -2
+1 -1
src/applications/diffusion/typeahead/DiffusionRepositoryDatasource.php
··· 41 41 $parts[] = $name; 42 42 43 43 $slug = $repository->getRepositorySlug(); 44 - if (strlen($slug)) { 44 + if (phutil_nonempty_string($slug)) { 45 45 $parts[] = $slug; 46 46 } 47 47
+1 -1
src/applications/repository/storage/PhabricatorRepository.php
··· 217 217 $monograms[] = 'R'.$this->getID(); 218 218 219 219 $callsign = $this->getCallsign(); 220 - if (strlen($callsign)) { 220 + if (phutil_nonempty_string($callsign)) { 221 221 $monograms[] = 'r'.$callsign; 222 222 } 223 223