@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 in DiffusionSourceLinkView

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.

```
DiffusionSourceLinkView.php:165: strlen(): Passing null to parameter #1 ($string) of type string is deprecated
```

Refs T16468

Test Plan: None.

Reviewers: O1 Blessed Committers, avivey

Reviewed By: O1 Blessed Committers, avivey

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

Maniphest Tasks: T16468

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

+1 -1
+1 -1
src/applications/diffusion/view/DiffusionSourceLinkView.php
··· 162 162 $icon = 'fa-file-text-o'; 163 163 164 164 $text = $this->getText(); 165 - if (!strlen($text)) { 165 + if (!phutil_nonempty_string($text)) { 166 166 $path = $this->getDisplayPath(); 167 167 168 168 $line = $this->getDisplayLine();