Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14145654
D21871.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
4 KB
Referenced Files
None
Subscribers
None
D21871.diff
View Options
diff --git a/src/applications/dashboard/controller/dashboard/PhabricatorDashboardAdjustController.php b/src/applications/dashboard/controller/dashboard/PhabricatorDashboardAdjustController.php
--- a/src/applications/dashboard/controller/dashboard/PhabricatorDashboardAdjustController.php
+++ b/src/applications/dashboard/controller/dashboard/PhabricatorDashboardAdjustController.php
@@ -32,7 +32,7 @@
$panel_ref = null;
$panel_key = $request->getStr('panelKey');
- if (strlen($panel_key)) {
+ if (phutil_nonempty_string($panel_key)) {
$panel_ref = $ref_list->getPanelRef($panel_key);
if (!$panel_ref) {
return new Aphront404Response();
@@ -42,7 +42,7 @@
}
$column_key = $request->getStr('columnKey');
- if (strlen($column_key)) {
+ if (phutil_nonempty_string($column_key)) {
$columns = $ref_list->getColumns();
if (!isset($columns[$column_key])) {
return new Aphront404Response();
@@ -52,7 +52,7 @@
$after_ref = null;
$after_key = $request->getStr('afterKey');
- if (strlen($after_key)) {
+ if (phutil_nonempty_string($after_key)) {
$after_ref = $ref_list->getPanelRef($after_key);
if (!$after_ref) {
return new Aphront404Response();
diff --git a/src/applications/dashboard/controller/panel/PhabricatorDashboardPanelEditController.php b/src/applications/dashboard/controller/panel/PhabricatorDashboardPanelEditController.php
--- a/src/applications/dashboard/controller/panel/PhabricatorDashboardPanelEditController.php
+++ b/src/applications/dashboard/controller/panel/PhabricatorDashboardPanelEditController.php
@@ -15,7 +15,7 @@
// editing.
$context_phid = $request->getStr('contextPHID');
- if (strlen($context_phid)) {
+ if (phutil_nonempty_string($context_phid)) {
$context = id(new PhabricatorObjectQuery())
->setViewer($viewer)
->withPHIDs(array($context_phid))
diff --git a/src/applications/dashboard/controller/panel/PhabricatorDashboardPanelTabsController.php b/src/applications/dashboard/controller/panel/PhabricatorDashboardPanelTabsController.php
--- a/src/applications/dashboard/controller/panel/PhabricatorDashboardPanelTabsController.php
+++ b/src/applications/dashboard/controller/panel/PhabricatorDashboardPanelTabsController.php
@@ -41,12 +41,12 @@
$op = $request->getURIData('op');
$after = $request->getStr('after');
- if (!strlen($after)) {
+ if (!phutil_nonempty_string($after)) {
$after = null;
}
$target = $request->getStr('target');
- if (!strlen($target)) {
+ if (!phutil_nonempty_string($target)) {
$target = null;
}
@@ -103,7 +103,7 @@
$context_phid = $request->getStr('contextPHID');
$context = null;
- if (strlen($context_phid)) {
+ if (phutil_nonempty_string($context_phid)) {
$context = id(new PhabricatorObjectQuery())
->setViewer($viewer)
->withPHIDs(array($context_phid))
diff --git a/src/applications/dashboard/paneltype/PhabricatorDashboardTabsPanelType.php b/src/applications/dashboard/paneltype/PhabricatorDashboardTabsPanelType.php
--- a/src/applications/dashboard/paneltype/PhabricatorDashboardTabsPanelType.php
+++ b/src/applications/dashboard/paneltype/PhabricatorDashboardTabsPanelType.php
@@ -101,7 +101,7 @@
$subpanel = idx($panels, $panel_id);
$name = idx($tab_spec, 'name');
- if (!strlen($name)) {
+ if ($name === null || !strlen($name)) {
if ($subpanel) {
$name = $subpanel->getName();
}
diff --git a/src/applications/dashboard/typeahead/PhabricatorDashboardPanelDatasource.php b/src/applications/dashboard/typeahead/PhabricatorDashboardPanelDatasource.php
--- a/src/applications/dashboard/typeahead/PhabricatorDashboardPanelDatasource.php
+++ b/src/applications/dashboard/typeahead/PhabricatorDashboardPanelDatasource.php
@@ -28,7 +28,7 @@
$query = new PhabricatorDashboardPanelQuery();
$raw_query = $this->getRawQuery();
- if (preg_match('/^[wW]\d+\z/', $raw_query)) {
+ if ($raw_query !== null && preg_match('/^[wW]\d+\z/', $raw_query)) {
$id = trim($raw_query, 'wW');
$id = (int)$id;
$query->withIDs(array($id));
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Dec 5, 12:18 AM (5 h, 3 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6826986
Default Alt Text
D21871.diff (4 KB)
Attached To
Mode
D21871: Addressing some PHP8 incompatibilities - Dashboard
Attached
Detach File
Event Timeline
Log In to Comment