phpmyadmin/libraries/classes/Controllers/Table/DropColumnConfirmationController.php
Maurício Meneghini Fauth 1438cb211e
Replace global keyword with $GLOBALS
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-03-07 17:31:11 -03:00

42 lines
1.1 KiB
PHP

<?php
declare(strict_types=1);
namespace PhpMyAdmin\Controllers\Table;
use PhpMyAdmin\Controllers\AbstractController;
use PhpMyAdmin\DbTableExists;
use PhpMyAdmin\Url;
use PhpMyAdmin\Util;
use function __;
final class DropColumnConfirmationController extends AbstractController
{
public function __invoke(): void
{
$selected = $_POST['selected_fld'] ?? null;
if (empty($selected)) {
$this->response->setRequestStatus(false);
$this->response->addJSON('message', __('No column selected.'));
return;
}
Util::checkParameters(['db', 'table']);
$GLOBALS['urlParams'] = ['db' => $GLOBALS['db'], 'table' => $GLOBALS['table']];
$GLOBALS['errorUrl'] = Util::getScriptNameForOption($GLOBALS['cfg']['DefaultTabTable'], 'table');
$GLOBALS['errorUrl'] .= Url::getCommon($GLOBALS['urlParams'], '&');
DbTableExists::check($GLOBALS['db'], $GLOBALS['table']);
$this->render('table/structure/drop_confirm', [
'db' => $GLOBALS['db'],
'table' => $GLOBALS['table'],
'fields' => $selected,
]);
}
}