| Server IP : 39.108.156.168 / Your IP : 216.73.216.104 Web Server : nginx/1.24.0 System : Linux e2.ksyuki.com 6.11.0-25-generic #25~24.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue Apr 15 17:20:50 UTC 2 x86_64 User : root ( 0) PHP Version : 8.3.6 Disable Function : NONE MySQL : OFF | cURL : OFF | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /var/www/html/php/libraries/classes/Controllers/Table/Structure/ |
Upload File : |
<?php
declare(strict_types=1);
namespace PhpMyAdmin\Controllers\Table\Structure;
use PhpMyAdmin\Controllers\Table\AbstractController;
use PhpMyAdmin\SqlParser\Context;
use function _ngettext;
use function count;
use function implode;
use function sprintf;
use function trim;
final class ReservedWordCheckController extends AbstractController
{
public function __invoke(): void
{
if ($GLOBALS['cfg']['ReservedWordDisableWarning'] !== false) {
$this->response->setRequestStatus(false);
return;
}
$columns_names = $_POST['field_name'];
$reserved_keywords_names = [];
foreach ($columns_names as $column) {
if (! Context::isKeyword(trim($column), true)) {
continue;
}
$reserved_keywords_names[] = trim($column);
}
if (Context::isKeyword(trim($this->table), true)) {
$reserved_keywords_names[] = trim($this->table);
}
if (count($reserved_keywords_names) === 0) {
$this->response->setRequestStatus(false);
}
$this->response->addJSON(
'message',
sprintf(
_ngettext(
'The name \'%s\' is a MySQL reserved keyword.',
'The names \'%s\' are MySQL reserved keywords.',
count($reserved_keywords_names)
),
implode(',', $reserved_keywords_names)
)
);
}
}