2016-10-22 14:57:10 +00:00
|
|
|
<?php
|
|
|
|
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
|
|
|
/**
|
|
|
|
* Validation callback.
|
|
|
|
*
|
|
|
|
* @package PhpMyAdmin-Setup
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Core libraries.
|
|
|
|
*/
|
|
|
|
require './lib/common.inc.php';
|
|
|
|
|
|
|
|
$validators = array();
|
2017-04-20 10:55:30 +00:00
|
|
|
require './libraries/config/validate.lib.php';
|
2016-10-22 14:57:10 +00:00
|
|
|
|
2017-04-20 10:55:30 +00:00
|
|
|
header('Content-type: application/json');
|
2016-10-22 14:57:10 +00:00
|
|
|
|
|
|
|
$ids = PMA_isValid($_POST['id'], 'scalar') ? $_POST['id'] : null;
|
|
|
|
$vids = explode(',', $ids);
|
|
|
|
$vals = PMA_isValid($_POST['values'], 'scalar') ? $_POST['values'] : null;
|
|
|
|
$values = json_decode($vals);
|
|
|
|
if (!($values instanceof stdClass)) {
|
|
|
|
PMA_fatalError(__('Wrong data'));
|
|
|
|
}
|
|
|
|
$values = (array)$values;
|
2017-04-20 10:55:30 +00:00
|
|
|
$result = PMA_config_validate($vids, $values, true);
|
2016-10-22 14:57:10 +00:00
|
|
|
if ($result === false) {
|
|
|
|
$result = sprintf(
|
|
|
|
__('Wrong data or no validation for %s'),
|
|
|
|
implode(',', $vids)
|
|
|
|
);
|
|
|
|
}
|
|
|
|
echo $result !== true ? json_encode($result) : '';
|
2017-04-20 10:55:30 +00:00
|
|
|
?>
|