You've already forked phpmyadmin
mirror of
https://github.com/phpmyadmin/phpmyadmin.git
synced 2026-10-29 21:24:44 +03:00
Remove the disp_query global variable
Replaces it with Current::$dispQuery static property. Signed-off-by: Maurício Meneghini Fauth <mauricio@mfauth.net>
This commit is contained in:
@@ -3939,12 +3939,6 @@ parameters:
|
||||
count: 1
|
||||
path: src/Controllers/Table/DeleteRowsController.php
|
||||
|
||||
-
|
||||
message: '#^Parameter \#8 \$dispQuery of method PhpMyAdmin\\Sql\:\:executeQueryAndSendQueryResponse\(\) expects string\|null, mixed given\.$#'
|
||||
identifier: argument.type
|
||||
count: 1
|
||||
path: src/Controllers/Table/DeleteRowsController.php
|
||||
|
||||
-
|
||||
message: '#^Argument of an invalid type mixed supplied for foreach, only iterables are supported\.$#'
|
||||
identifier: foreach.nonIterable
|
||||
|
||||
@@ -2261,7 +2261,6 @@
|
||||
<code><![CDATA[$request->getQueryParam('sql_signature')]]></code>
|
||||
</MixedArgument>
|
||||
<MixedAssignment>
|
||||
<code><![CDATA[$GLOBALS['disp_query']]]></code>
|
||||
<code><![CDATA[$GLOBALS['message_to_show']]]></code>
|
||||
<code><![CDATA[$bkmAllUsers]]></code>
|
||||
<code><![CDATA[$sqlQuery]]></code>
|
||||
@@ -2426,11 +2425,9 @@
|
||||
<code><![CDATA[$_REQUEST['pos']]]></code>
|
||||
</InvalidArgument>
|
||||
<MixedArgument>
|
||||
<code><![CDATA[$GLOBALS['disp_query'] ?? null]]></code>
|
||||
<code><![CDATA[$row]]></code>
|
||||
</MixedArgument>
|
||||
<MixedAssignment>
|
||||
<code><![CDATA[$GLOBALS['disp_query']]]></code>
|
||||
<code><![CDATA[$row]]></code>
|
||||
</MixedAssignment>
|
||||
<PossiblyInvalidIterator>
|
||||
@@ -2803,7 +2800,6 @@
|
||||
<code><![CDATA[$mimeMap[$columnName]]]></code>
|
||||
</MixedArrayOffset>
|
||||
<MixedAssignment>
|
||||
<code><![CDATA[$GLOBALS['disp_query']]]></code>
|
||||
<code><![CDATA[$clauseIsUnique]]></code>
|
||||
<code><![CDATA[$columnName]]></code>
|
||||
<code><![CDATA[$columnName]]></code>
|
||||
|
||||
@@ -42,7 +42,6 @@ class SqlController implements InvocableController
|
||||
|
||||
public function __invoke(ServerRequest $request): Response
|
||||
{
|
||||
$GLOBALS['disp_query'] ??= null;
|
||||
$GLOBALS['message_to_show'] ??= null;
|
||||
|
||||
$this->pageSettings->init('Browse');
|
||||
@@ -182,7 +181,7 @@ class SqlController implements InvocableController
|
||||
Import::$importText,
|
||||
$GLOBALS['message_to_show'] ?? '',
|
||||
UrlParams::$goto,
|
||||
isset($GLOBALS['disp_query']) ? Current::$displayQuery : null,
|
||||
isset(Current::$dispQuery) ? Current::$displayQuery : null,
|
||||
Current::$displayMessage ?? '',
|
||||
Current::$sqlQuery,
|
||||
Current::$completeQuery ?? Current::$sqlQuery,
|
||||
|
||||
@@ -35,8 +35,6 @@ final class DeleteRowsController implements InvocableController
|
||||
|
||||
public function __invoke(ServerRequest $request): Response
|
||||
{
|
||||
$GLOBALS['disp_query'] ??= null;
|
||||
|
||||
$multBtn = $_POST['mult_btn'] ?? '';
|
||||
$selected = $_POST['selected'] ?? [];
|
||||
|
||||
@@ -74,7 +72,7 @@ final class DeleteRowsController implements InvocableController
|
||||
ForeignKey::handleDisableCheckCleanup($defaultFkCheckValue);
|
||||
|
||||
Current::$displayMessage = __('Your SQL query has been executed successfully.');
|
||||
$GLOBALS['disp_query'] = Current::$sqlQuery;
|
||||
Current::$dispQuery = Current::$sqlQuery;
|
||||
}
|
||||
|
||||
if ($request->hasBodyParam('original_sql_query')) {
|
||||
@@ -89,7 +87,7 @@ final class DeleteRowsController implements InvocableController
|
||||
'',
|
||||
'',
|
||||
UrlParams::$goto,
|
||||
$GLOBALS['disp_query'] ?? null,
|
||||
Current::$dispQuery,
|
||||
Current::$displayMessage ?? '',
|
||||
Current::$sqlQuery,
|
||||
Current::$sqlQuery,
|
||||
|
||||
@@ -70,8 +70,6 @@ final class ReplaceController implements InvocableController
|
||||
return $this->response->missingParameterError('goto');
|
||||
}
|
||||
|
||||
$GLOBALS['disp_query'] ??= null;
|
||||
|
||||
$this->dbi->selectDb(Current::$database);
|
||||
|
||||
$this->response->addScriptFiles(['makegrid.js', 'sql.js', 'gis_data_editor.js']);
|
||||
@@ -362,7 +360,7 @@ final class ReplaceController implements InvocableController
|
||||
}
|
||||
|
||||
if (! empty($returnToSqlQuery)) {
|
||||
$GLOBALS['disp_query'] = Current::$sqlQuery;
|
||||
Current::$dispQuery = Current::$sqlQuery;
|
||||
Current::$displayMessage = Current::$message;
|
||||
Current::$message = null;
|
||||
Current::$sqlQuery = $returnToSqlQuery;
|
||||
|
||||
@@ -16,6 +16,7 @@ final class Current
|
||||
/** @var array<string>|string|null */
|
||||
public static array|string|null $whereClause = null;
|
||||
public static string|null $displayQuery = null;
|
||||
public static string|null $dispQuery = null;
|
||||
public static string|null $charset = null;
|
||||
public static string|null $completeQuery = null;
|
||||
public static Message|string|null $displayMessage = null;
|
||||
|
||||
Reference in New Issue
Block a user