1
0
mirror of https://github.com/phpmyadmin/phpmyadmin.git synced 2026-10-29 21:24:44 +03:00

Check if db and table are strings in RecentFavoriteController

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
This commit is contained in:
Maurício Meneghini Fauth
2022-02-25 14:11:43 -03:00
parent ee744a6fd5
commit 38564b5477
2 changed files with 6 additions and 8 deletions

View File

@@ -8,6 +8,8 @@ use PhpMyAdmin\Controllers\AbstractController;
use PhpMyAdmin\Controllers\Sql\SqlController;
use PhpMyAdmin\RecentFavoriteTable;
use function is_string;
/**
* Browse recent and favorite tables chosen from navigation.
*/
@@ -17,9 +19,11 @@ class RecentFavoriteController extends AbstractController
{
$GLOBALS['containerBuilder'] = $GLOBALS['containerBuilder'] ?? null;
RecentFavoriteTable::getInstance('recent')->removeIfInvalid($_REQUEST['db'], $_REQUEST['table']);
$db = isset($_REQUEST['db']) && is_string($_REQUEST['db']) ? $_REQUEST['db'] : '';
$table = isset($_REQUEST['table']) && is_string($_REQUEST['table']) ? $_REQUEST['table'] : '';
RecentFavoriteTable::getInstance('favorite')->removeIfInvalid($_REQUEST['db'], $_REQUEST['table']);
RecentFavoriteTable::getInstance('recent')->removeIfInvalid($db, $table);
RecentFavoriteTable::getInstance('favorite')->removeIfInvalid($db, $table);
/** @var SqlController $controller */
$controller = $GLOBALS['containerBuilder']->get(SqlController::class);

View File

@@ -3556,12 +3556,6 @@
</MixedArgument>
</file>
<file src="libraries/classes/Controllers/Table/RecentFavoriteController.php">
<MixedArgument occurrences="4">
<code>$_REQUEST['db']</code>
<code>$_REQUEST['db']</code>
<code>$_REQUEST['table']</code>
<code>$_REQUEST['table']</code>
</MixedArgument>
<PossiblyNullReference occurrences="1">
<code>get</code>
</PossiblyNullReference>