Skip to content

Commit 217c635

Browse files
committed
Fix FavoriteTableController error when missing db param
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
1 parent 9faaad4 commit 217c635

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

‎libraries/classes/Controllers/AbstractController.php‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ protected function checkParameters(array $params, bool $request = false): void
143143
return;
144144
}
145145

146+
$this->response->setHttpResponseCode(400);
146147
Core::fatalError($errorMessage);
147148
}
148149
}

‎libraries/classes/Controllers/Database/Structure/FavoriteTableController.php‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ public function __invoke(): void
4040
'sync_favorite_tables' => $_REQUEST['sync_favorite_tables'] ?? null,
4141
];
4242

43-
$this->checkParameters(['db']);
43+
if ($GLOBALS['db'] === '') {
44+
return;
45+
}
4446

4547
$GLOBALS['errorUrl'] = Util::getScriptNameForOption($GLOBALS['cfg']['DefaultTabDatabase'], 'database');
4648
$GLOBALS['errorUrl'] .= Url::getCommon(['db' => $GLOBALS['db']], '&');

0 commit comments

Comments
 (0)