mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-25 00:02:41 +01:00
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
This commit is contained in:
parent
7868ab3754
commit
1720209f16
5 changed files with 6 additions and 5 deletions
|
@ -32,7 +32,7 @@ final class PhabricatorDashboardAdjustController
|
|||
|
||||
$panel_ref = null;
|
||||
$panel_key = $request->getStr('panelKey');
|
||||
if (strlen($panel_key)) {
|
||||
if ($panel_key !== null && strlen($panel_key)) {
|
||||
$panel_ref = $ref_list->getPanelRef($panel_key);
|
||||
if (!$panel_ref) {
|
||||
return new Aphront404Response();
|
||||
|
|
|
@ -41,12 +41,12 @@ final class PhabricatorDashboardPanelTabsController
|
|||
|
||||
$op = $request->getURIData('op');
|
||||
$after = $request->getStr('after');
|
||||
if (!strlen($after)) {
|
||||
if ($after === '') {
|
||||
$after = null;
|
||||
}
|
||||
|
||||
$target = $request->getStr('target');
|
||||
if (!strlen($target)) {
|
||||
if ($target === '') {
|
||||
$target = null;
|
||||
}
|
||||
|
||||
|
|
|
@ -155,6 +155,7 @@ final class PhabricatorDashboardPanelRenderingEngine extends Phobject {
|
|||
|
||||
return $this->renderNormalPanel();
|
||||
} catch (Exception $ex) {
|
||||
phlog($ex);
|
||||
return $this->renderErrorPanel(
|
||||
$panel->getName(),
|
||||
pht(
|
||||
|
|
|
@ -100,7 +100,7 @@ final class PhabricatorDashboardTabsPanelType
|
|||
$panel_id = idx($tab_spec, 'panelID');
|
||||
$subpanel = idx($panels, $panel_id);
|
||||
|
||||
$name = idx($tab_spec, 'name');
|
||||
$name = coalesce(idx($tab_spec, 'name'), '');
|
||||
if (!strlen($name)) {
|
||||
if ($subpanel) {
|
||||
$name = $subpanel->getName();
|
||||
|
|
|
@ -27,7 +27,7 @@ final class PhabricatorFerretSearchEngineExtension
|
|||
PhabricatorSavedQuery $saved,
|
||||
array $map) {
|
||||
|
||||
if (!strlen($map['query'])) {
|
||||
if (!(isset($map['query']) && strlen($map['query']))) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue