mirror of
https://github.com/cytopia/devilbox.git
synced 2024-12-29 09:08:51 +00:00
36 lines
832 B
PHP
36 lines
832 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/validate.lib.php';
|
|
|
|
header('Content-type: application/json');
|
|
|
|
$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;
|
|
$result = PMA_config_validate($vids, $values, true);
|
|
if ($result === false) {
|
|
$result = sprintf(
|
|
__('Wrong data or no validation for %s'),
|
|
implode(',', $vids)
|
|
);
|
|
}
|
|
echo $result !== true ? json_encode($result) : '';
|
|
?>
|