@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 PhabricatorRepository generateURI PHP 8.1 strlen(null) errors

Summary:
When viewing a repository in Diffusion, clicking on a folder (eg https://my.phorge.site/source/myrepo/browse/master/myfolder/) will generate multiple strlen(null) exceptions under PHP 8.1

Fix is to replace all the strlen() calls with phutil_nonempty_string()

Fixes T15532

Test Plan: View a folder in a repo in Diffusion. Eg https://my.phorge.site/source/myrepo/browse/master/myfolder/

Reviewers: O1 Blessed Committers, avivey

Reviewed By: O1 Blessed Committers, avivey

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

Maniphest Tasks: T15532

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

+4 -4
+4 -4
src/applications/repository/storage/PhabricatorRepository.php
··· 779 779 break; 780 780 case 'compare': 781 781 $uri = $this->getPathURI("/{$action}/"); 782 - if (strlen($head)) { 782 + if (phutil_nonempty_scalar($head)) { 783 783 $query['head'] = $head; 784 - } else if (strlen($raw_commit)) { 784 + } else if (phutil_nonempty_scalar($raw_commit)) { 785 785 $query['commit'] = $raw_commit; 786 - } else if (strlen($raw_branch)) { 786 + } else if (phutil_nonempty_scalar($raw_branch)) { 787 787 $query['head'] = $raw_branch; 788 788 } 789 789 790 - if (strlen($against)) { 790 + if (phutil_nonempty_scalar($against)) { 791 791 $query['against'] = $against; 792 792 } 793 793 break;