@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 rendering a config page

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 T15336

Test Plan: Applied this change and `/config/edit/load-libraries/` correctly rendered in web browser.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

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

Maniphest Tasks: T15336

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

authored by

Valerio Bozzolan and committed by
Andre Klapper
8eaa7c1c 953726d7

+12 -1
+12 -1
src/applications/config/option/PhabricatorConfigOption.php
··· 156 156 return $this->summary; 157 157 } 158 158 159 + /** 160 + * Set the human Description of this Config 161 + * 162 + * @param string|null $description Description as raw Remarkup 163 + * @return self 164 + */ 159 165 public function setDescription($description) { 160 166 $this->description = $description; 161 167 return $this; 162 168 } 163 169 170 + /** 171 + * Get the human Description of this Config 172 + * 173 + * @return string|null Description as raw Remarkup 174 + */ 164 175 public function getDescription() { 165 176 return $this->description; 166 177 } ··· 205 216 206 217 public function newDescriptionRemarkupView(PhabricatorUser $viewer) { 207 218 $description = $this->getDescription(); 208 - if (!strlen($description)) { 219 + if (!phutil_nonempty_string($description)) { 209 220 return null; 210 221 } 211 222