diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon
index b07f58b3b1..db786c5e93 100644
--- a/phpstan-baseline.neon
+++ b/phpstan-baseline.neon
@@ -5212,7 +5212,7 @@ parameters:
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
- count: 5
+ count: 4
path: src/Controllers/Sql/SqlController.php
-
diff --git a/psalm-baseline.xml b/psalm-baseline.xml
index 972f08ae4d..ca234ddd3f 100644
--- a/psalm-baseline.xml
+++ b/psalm-baseline.xml
@@ -3208,7 +3208,6 @@
-
@@ -3233,7 +3232,6 @@
-
$bkmAllUsers
$sqlQuery
diff --git a/src/Controllers/Sql/SqlController.php b/src/Controllers/Sql/SqlController.php
index 6e4b09148d..88a474d6c9 100644
--- a/src/Controllers/Sql/SqlController.php
+++ b/src/Controllers/Sql/SqlController.php
@@ -54,7 +54,6 @@ class SqlController extends AbstractController
$GLOBALS['disp_message'] ??= null;
$GLOBALS['complete_query'] ??= null;
$GLOBALS['back'] ??= null;
- $GLOBALS['table_from_sql'] ??= null;
$this->checkUserPrivileges->getPrivileges();
@@ -139,13 +138,10 @@ class SqlController extends AbstractController
/**
* Parse and analyze the query
*/
- [$statementInfo, $GLOBALS['db'], $GLOBALS['table_from_sql']] = ParseAnalyze::sqlQuery(
- $GLOBALS['sql_query'],
- $GLOBALS['db'],
- );
+ [$statementInfo, $GLOBALS['db'], $tableFromSql] = ParseAnalyze::sqlQuery($GLOBALS['sql_query'], $GLOBALS['db']);
- if ($GLOBALS['table'] != $GLOBALS['table_from_sql'] && ! empty($GLOBALS['table_from_sql'])) {
- $GLOBALS['table'] = $GLOBALS['table_from_sql'];
+ if ($GLOBALS['table'] != $tableFromSql && $tableFromSql !== '') {
+ $GLOBALS['table'] = $tableFromSql;
}
/**