Update config classes. Add @noinspection tag. Update documentation and script. Set ConfigGenerator in a namespace. Rename ConfigGenerator filename. Remove ConfigGenerator requires. Fix namespaces of mock objects. Remove useless require. Add missing 'use'. Add missing require. Update PHPDoc. Fix class test typo. Signed-off-by: Hugues Peccatte <hugues.peccatte@gmail.com>
32 lines
789 B
PHP
32 lines
789 B
PHP
<?php
|
|
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
|
/**
|
|
* Validation callback.
|
|
*
|
|
* @package PhpMyAdmin-Setup
|
|
*/
|
|
|
|
/**
|
|
* Core libraries.
|
|
*/
|
|
require './lib/common.inc.php';
|
|
|
|
$validators = array();
|
|
require './libraries/config/Validator.php';
|
|
|
|
header('Content-type: application/json');
|
|
|
|
$ids = isset($_POST['id']) ? $_POST['id'] : null;
|
|
$vids = explode(',', $ids);
|
|
$vals = isset($_POST['values']) ? $_POST['values'] : null;
|
|
$values = json_decode($vals);
|
|
if (!($values instanceof stdClass)) {
|
|
PMA_fatalError(__('Wrong data'));
|
|
}
|
|
$values = (array)$values;
|
|
$result = PMA\libraries\config\Validator::validate($GLOBALS['ConfigFile'], $vids, $values, true);
|
|
if ($result === false) {
|
|
$result = 'Wrong data or no validation for ' . $vids;
|
|
}
|
|
echo $result !== true ? json_encode($result) : '';
|