@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 numerous PHP 8.1 "strlen(null)" exceptions which block rendering the Applications 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 T15294

Test Plan: Applied these three changes and `/applications/` 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: T15294

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

+3 -3
+1 -1
src/applications/meta/query/PhabricatorAppSearchEngine.php
··· 45 45 ->withUnlisted(false); 46 46 47 47 $name = $saved->getParameter('name'); 48 - if (strlen($name)) { 48 + if (phutil_nonempty_string($name)) { 49 49 $query->withNameContains($name); 50 50 } 51 51
+1 -1
src/applications/search/controller/PhabricatorApplicationSearchController.php
··· 115 115 if ($this->queryKey == 'advanced') { 116 116 $run_query = false; 117 117 $query_key = $request->getStr('query'); 118 - } else if (!strlen($this->queryKey)) { 118 + } else if (!phutil_nonempty_string($this->queryKey)) { 119 119 $found_query_data = false; 120 120 121 121 if ($request->isHTTPGet() || $request->isQuicksand()) {
+1 -1
src/view/layout/AphrontSideNavFilterView.php
··· 145 145 146 146 public function selectFilter($key, $default = null) { 147 147 $this->selectedFilter = $default; 148 - if ($this->menu->getItem($key) && strlen($key)) { 148 + if ($this->menu->getItem($key) && phutil_nonempty_string($key)) { 149 149 $this->selectedFilter = $key; 150 150 } 151 151 return $this->selectedFilter;