1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-25 16:22:43 +01:00

Fix /dashboard/adjust/remove/ PHP 8.1 strlen(null) errors

Summary:
/dashboard/adjust/remove/ POST requests fail under PHP 8.1 with strlen(null) errors.

This change fixes it.

Fixes T15549

Test Plan:
View a dashboard which has some panels. Eg https://my.phorge.site/dashboard/view/1/
Click on a 'Manage Panel' dropdown and click on 'Remove Panel'

Confirm the panel is removed and no strlen(null) errors are generated.

Reviewers: O1 Blessed Committers, avivey

Reviewed By: O1 Blessed Committers, avivey

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

Maniphest Tasks: T15549

Differential Revision: https://we.phorge.it/D25345
This commit is contained in:
Steve Campbell 2023-07-13 10:23:49 +01:00
parent 85539ce255
commit f7dd8f579a

View file

@ -42,7 +42,7 @@ final class PhabricatorDashboardAdjustController
}
$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 @@ final class PhabricatorDashboardAdjustController
$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();