Access _POST and _SESSION directly

Signed-off-by: Maurício Meneghini Fauth <mauricio@mfauth.net>
This commit is contained in:
Maurício Meneghini Fauth 2025-01-10 18:19:47 -03:00
parent 657d1d0784
commit fa744d78a4
No known key found for this signature in database
GPG Key ID: 6A16FD38AFC89CC8
4 changed files with 9 additions and 19 deletions

View File

@ -20712,12 +20712,6 @@ parameters:
count: 1
path: tests/unit/SqlTest.php
-
message: '#^Cannot access offset ''tmpval'' on mixed\.$#'
identifier: offsetAccess.nonOffsetAccessible
count: 4
path: tests/unit/SqlTest.php
-
message: '#^Method PhpMyAdmin\\Tests\\Stubs\\DbiDummy\:\:connect\(\) never returns null so it can be removed from the return type\.$#'
identifier: return.unusedType

View File

@ -12676,14 +12676,10 @@
<code><![CDATA[Config::getInstance()]]></code>
</DeprecatedMethod>
<MixedArrayAssignment>
<code><![CDATA[$GLOBALS['_SESSION']['tmpval']]]></code>
<code><![CDATA[$GLOBALS['_SESSION']['tmpval']]]></code>
<code><![CDATA[$GLOBALS['_SESSION']['tmpval']]]></code>
<code><![CDATA[$GLOBALS['_SESSION']['tmpval']]]></code>
<code><![CDATA[$GLOBALS['_SESSION']['tmpval']['max_rows']]]></code>
<code><![CDATA[$GLOBALS['_SESSION']['tmpval']['max_rows']]]></code>
<code><![CDATA[$GLOBALS['_SESSION']['tmpval']['max_rows']]]></code>
<code><![CDATA[$GLOBALS['_SESSION']['tmpval']['pos']]]></code>
<code><![CDATA[$_SESSION['tmpval']['max_rows']]]></code>
<code><![CDATA[$_SESSION['tmpval']['max_rows']]]></code>
<code><![CDATA[$_SESSION['tmpval']['max_rows']]]></code>
<code><![CDATA[$_SESSION['tmpval']['pos']]]></code>
</MixedArrayAssignment>
<PossiblyUnusedMethod>
<code><![CDATA[dataProviderCountQueryResults]]></code>

View File

@ -27,7 +27,7 @@ class SearchTest extends AbstractTestCase
parent::setUp();
Current::$database = 'pma';
$GLOBALS['_POST'] = [];
$_POST = [];
//mock DBI
$dbi = $this->getMockBuilder(DatabaseInterface::class)

View File

@ -79,8 +79,8 @@ class SqlTest extends AbstractTestCase
public function testGetSqlWithLimitClause(): void
{
// Test environment.
$GLOBALS['_SESSION']['tmpval']['pos'] = 1;
$GLOBALS['_SESSION']['tmpval']['max_rows'] = 2;
$_SESSION['tmpval']['pos'] = 1;
$_SESSION['tmpval']['max_rows'] = 2;
self::assertSame('SELECT * FROM test LIMIT 1, 2', $this->callFunction(
$this->sql,
@ -135,7 +135,7 @@ class SqlTest extends AbstractTestCase
public function testIsAppendLimitClause(): void
{
// Test environment.
$GLOBALS['_SESSION']['tmpval']['max_rows'] = 10;
$_SESSION['tmpval']['max_rows'] = 10;
self::assertTrue(
$this->callFunction($this->sql, Sql::class, 'isAppendLimitClause', [
@ -153,7 +153,7 @@ class SqlTest extends AbstractTestCase
public function testIsJustBrowsing(): void
{
// Test environment.
$GLOBALS['_SESSION']['tmpval']['max_rows'] = 10;
$_SESSION['tmpval']['max_rows'] = 10;
self::assertTrue(Sql::isJustBrowsing(
ParseAnalyze::sqlQuery('SELECT * FROM db.tbl', Current::$database)[0],