@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.

Various PHP 8.1 strlen(null) fixes for Dashboard Panels

Summary:
In the dashboard application (https://my.phorge.site/dashboard/), when creating panels, adding panels to tab panels, and viewing query panels, we get a variety of strlen(null) errors under PHP 8.1.

This fixes all the ones seen.

Fixes T15574

Test Plan: See T15574

Reviewers: O1 Blessed Committers, avivey

Reviewed By: O1 Blessed Committers, avivey

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

Maniphest Tasks: T15574

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

sten 1720209f 7868ab37

+6 -5
+1 -1
src/applications/dashboard/controller/dashboard/PhabricatorDashboardAdjustController.php
··· 32 32 33 33 $panel_ref = null; 34 34 $panel_key = $request->getStr('panelKey'); 35 - if (strlen($panel_key)) { 35 + if ($panel_key !== null && strlen($panel_key)) { 36 36 $panel_ref = $ref_list->getPanelRef($panel_key); 37 37 if (!$panel_ref) { 38 38 return new Aphront404Response();
+2 -2
src/applications/dashboard/controller/panel/PhabricatorDashboardPanelTabsController.php
··· 41 41 42 42 $op = $request->getURIData('op'); 43 43 $after = $request->getStr('after'); 44 - if (!strlen($after)) { 44 + if ($after === '') { 45 45 $after = null; 46 46 } 47 47 48 48 $target = $request->getStr('target'); 49 - if (!strlen($target)) { 49 + if ($target === '') { 50 50 $target = null; 51 51 } 52 52
+1
src/applications/dashboard/engine/PhabricatorDashboardPanelRenderingEngine.php
··· 155 155 156 156 return $this->renderNormalPanel(); 157 157 } catch (Exception $ex) { 158 + phlog($ex); 158 159 return $this->renderErrorPanel( 159 160 $panel->getName(), 160 161 pht(
+1 -1
src/applications/dashboard/paneltype/PhabricatorDashboardTabsPanelType.php
··· 100 100 $panel_id = idx($tab_spec, 'panelID'); 101 101 $subpanel = idx($panels, $panel_id); 102 102 103 - $name = idx($tab_spec, 'name'); 103 + $name = coalesce(idx($tab_spec, 'name'), ''); 104 104 if (!strlen($name)) { 105 105 if ($subpanel) { 106 106 $name = $subpanel->getName();
+1 -1
src/applications/search/engineextension/PhabricatorFerretSearchEngineExtension.php
··· 27 27 PhabricatorSavedQuery $saved, 28 28 array $map) { 29 29 30 - if (!strlen($map['query'])) { 30 + if (!(isset($map['query']) && strlen($map['query']))) { 31 31 return; 32 32 } 33 33