@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)" exception which blocks creating personal and global Herald rules

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 T15348

Test Plan:
Applied this change (on top of D25157) and creation form at `/herald/edit/?content_type=HeraldPreCommitRefAdapter&rule_type=personal` rendered in web browser.
Same applies for other types of personal and global Herald rules.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

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

Maniphest Tasks: T15348

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

+8 -1
+7
src/infrastructure/contentsource/PhabricatorContentSource.php
··· 81 81 )); 82 82 } 83 83 84 + /** 85 + * Get the internal source name 86 + * 87 + * This is usually coming from a SOURCECONST constant. 88 + * 89 + * @return string|null 90 + */ 84 91 final public function getSource() { 85 92 return $this->source; 86 93 }
+1 -1
src/infrastructure/contentsource/PhabricatorUnknownContentSource.php
··· 7 7 8 8 public function getSourceName() { 9 9 $source = $this->getSource(); 10 - if (strlen($source)) { 10 + if ($source) { 11 11 return pht('Unknown ("%s")', $source); 12 12 } else { 13 13 return pht('Unknown');