@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 a PHP 8.1 deprecated use of strlen with a NULL argument on commit page

Summary:
With PHP 8.1+ it is not possible to view a commit if the author field is not properly defined
Indeed, if the commit author is not properly defined, strlen(null) is called, causing a deprecation warning, elevated to exception.
Using strlen() to check string validity is deprecated since PHP 8.1. Phorge adopts phutil_nonempty_string() as a replacement.

Fix T15628

Test Plan:
- Push a new commit on a subversion repository (since T15629 is not yet addressed)
- Visualize the commit
- You should not get a RuntimeException

Reviewers: O1 Blessed Committers, Sten, valerio.bozzolan

Reviewed By: O1 Blessed Committers, Sten, valerio.bozzolan

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

Maniphest Tasks: T15628

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

bob acfb44d6 5bd52664

+1 -1
+1 -1
src/applications/repository/storage/PhabricatorRepositoryCommitData.php
··· 97 97 $ref = $this->getCommitRef(); 98 98 99 99 $author = $ref->getAuthor(); 100 - if (strlen($author)) { 100 + if (phutil_nonempty_string($author)) { 101 101 return $author; 102 102 } 103 103