From 5154e55c9bf614a4e3628a9516a06e08f865492b Mon Sep 17 00:00:00 2001 From: Andre Klapper Date: Thu, 22 Jan 2026 12:44:36 +0000 Subject: [PATCH] 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 --- src/applications/diffusion/view/DiffusionSourceLinkView.php | 2 +- 1 file(s) changed, 1 insertion(s)(+), 1 deletion(s)(-) diff --git a/src/applications/diffusion/view/DiffusionSourceLinkView.php b/src/applications/diffusion/view/DiffusionSourceLinkView.php --- a/src/applications/diffusion/view/DiffusionSourceLinkView.php +++ b/src/applications/diffusion/view/DiffusionSourceLinkView.php @@ -162,7 +162,7 @@ $icon = 'fa-file-text-o'; $text = $this->getText(); - if (!strlen($text)) { + if (!phutil_nonempty_string($text)) { $path = $this->getDisplayPath(); $line = $this->getDisplayLine(); -- tangled.sh