@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 which block rendering the Dashboard 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 T15295

Test Plan: Applied these four changes (on top of D25144 and D25145) and `/dashboard/` finally 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: T15295

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

+10 -4
+1 -1
src/applications/search/controller/PhabricatorApplicationSearchController.php
··· 775 775 $force_nux) { 776 776 777 777 // Don't render NUX if the user has clicked away from the default page. 778 - if (strlen($this->getQueryKey())) { 778 + if (phutil_nonempty_string($this->getQueryKey())) { 779 779 return null; 780 780 } 781 781
+1 -1
src/applications/search/engine/PhabricatorApplicationSearchEngine.php
··· 179 179 180 180 $order = $saved->getParameter('order'); 181 181 $builtin = $query->getBuiltinOrderAliasMap(); 182 - if (strlen($order) && isset($builtin[$order])) { 182 + if (phutil_nonempty_string($order) && isset($builtin[$order])) { 183 183 $query->setOrder($order); 184 184 } else { 185 185 // If the order is invalid or not available, we choose the first
+1 -1
src/view/form/control/AphrontFormTokenizerControl.php
··· 68 68 $datasource->setViewer($this->getUser()); 69 69 70 70 $placeholder = null; 71 - if (!strlen($this->placeholder)) { 71 + if (!phutil_nonempty_string($this->placeholder)) { 72 72 $placeholder = $datasource->getPlaceholderText(); 73 73 } 74 74
+7 -1
src/view/phui/PHUIInfoView.php
··· 19 19 private $flush; 20 20 private $icon; 21 21 22 + /** 23 + * Set a title 24 + * 25 + * @param string|null $title 26 + * @return self 27 + */ 22 28 public function setTitle($title) { 23 29 $this->title = $title; 24 30 return $this; ··· 147 153 } 148 154 149 155 $title = $this->title; 150 - if ($title || strlen($title)) { 156 + if ($title || phutil_nonempty_string($title)) { 151 157 $title = phutil_tag( 152 158 'h1', 153 159 array(