@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 in Phame transactions

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.

```
strlen(): Passing null to parameter #1 ($string) of type string is deprecated at [PhameBlogParentDomainTransaction.php:18]
strlen(): Passing null to parameter #1 ($string) of type string is deprecated at [PhameBlogFullDomainTransaction.php:25]
```

Ref T15064

Test Plan: Unknown, presumably change the parent domain of a Phame blog. These only became visible after D26732 was applied.

Reviewers: O1 Blessed Committers, aklapper

Reviewed By: O1 Blessed Committers, aklapper

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

Maniphest Tasks: T15064

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

+6 -6
+2 -2
src/applications/phame/xaction/PhameBlogFullDomainTransaction.php
··· 22 22 23 23 public function getTitle() { 24 24 $old = $this->getOldValue(); 25 - if (!strlen($old)) { 25 + if (!phutil_nonempty_string($old)) { 26 26 return pht( 27 27 '%s set this blog\'s full domain to %s.', 28 28 $this->renderAuthor(), ··· 38 38 39 39 public function getTitleForFeed() { 40 40 $old = $this->getOldValue(); 41 - if (!strlen($old)) { 41 + if (!phutil_nonempty_string($old)) { 42 42 return pht( 43 43 '%s set %s blog\'s full domain to %s.', 44 44 $this->renderAuthor(),
+2 -2
src/applications/phame/xaction/PhameBlogParentDomainTransaction.php
··· 15 15 16 16 public function getTitle() { 17 17 $old = $this->getOldValue(); 18 - if (!strlen($old)) { 18 + if (!phutil_nonempty_string($old)) { 19 19 return pht( 20 20 '%s set this blog\'s parent domain to %s.', 21 21 $this->renderAuthor(), ··· 31 31 32 32 public function getTitleForFeed() { 33 33 $old = $this->getOldValue(); 34 - if (!strlen($old)) { 34 + if (!phutil_nonempty_string($old)) { 35 35 return pht( 36 36 '%s set %s blog\'s parent domain to %s.', 37 37 $this->renderAuthor(),
+2 -2
src/applications/phame/xaction/PhameBlogParentSiteTransaction.php
··· 15 15 16 16 public function getTitle() { 17 17 $old = $this->getOldValue(); 18 - if (!strlen($old)) { 18 + if (!phutil_nonempty_string($old)) { 19 19 return pht( 20 20 '%s set this blog\'s parent site to %s.', 21 21 $this->renderAuthor(), ··· 31 31 32 32 public function getTitleForFeed() { 33 33 $old = $this->getOldValue(); 34 - if (!strlen($old)) { 34 + if (!phutil_nonempty_string($old)) { 35 35 return pht( 36 36 '%s set %s blog\'s parent site to %s.', 37 37 $this->renderAuthor(),