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
);
17 // phpcs:disable PSR1.Files.SideEffects
18 define('PHPMYADMIN', true);
21 require ROOT_PATH
. 'setup/lib/common.inc.php';
26 $ids = isset($_POST['id']) && is_scalar($_POST['id']) ?
(string) $_POST['id'] : '';
27 $vids = explode(',', $ids);
28 $vals = isset($_POST['values']) && is_scalar($_POST['values']) ?
(string) $_POST['values'] : '';
29 $values = json_decode($vals);
30 if (! ($values instanceof stdClass
)) {
31 Core
::fatalError(__('Wrong data'));
34 $values = (array) $values;
35 $result = Validator
::validate($GLOBALS['ConfigFile'], $vids, $values, true);
36 if ($result === false) {
38 __('Wrong data or no validation for %s'),
43 echo $result !== true ?
json_encode($result) : '';