6 declare(strict_types
=1);
8 use PhpMyAdmin\Config\Validator
;
11 if (! defined('ROOT_PATH')) {
12 // phpcs:disable PSR1.Files.SideEffects
13 define('ROOT_PATH', dirname(__DIR__
) . DIRECTORY_SEPARATOR
);
20 require ROOT_PATH
. 'setup/lib/common.inc.php';
26 $ids = Core
::isValid($_POST['id'], 'scalar') ?
$_POST['id'] : null;
27 $vids = explode(',', $ids);
28 $vals = Core
::isValid($_POST['values'], 'scalar') ?
$_POST['values'] : null;
29 $values = json_decode($vals);
30 if (! ($values instanceof stdClass
)) {
31 Core
::fatalError(__('Wrong data'));
33 $values = (array) $values;
34 $result = Validator
::validate($GLOBALS['ConfigFile'], $vids, $values, true);
35 if ($result === false) {
37 __('Wrong data or no validation for %s'),
41 echo $result !== true ?
json_encode($result) : '';