mirror of
https://github.com/YunoHost-Apps/phpmyadmin_ynh.git
synced 2024-09-03 19:56:46 +02:00
30 lines
727 B
PHP
30 lines
727 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.class.php';
|
|
|
|
header('Content-type: application/json');
|
|
|
|
$vids = explode(',', filter_input(INPUT_POST, 'id'));
|
|
$values = json_decode(filter_input(INPUT_POST, 'values'));
|
|
if (!($values instanceof stdClass)) {
|
|
PMA_fatalError(__('Wrong data'));
|
|
}
|
|
$values = (array)$values;
|
|
$result = PMA_Validator::validate($GLOBALS['ConfigFile'], $vids, $values, true);
|
|
if ($result === false) {
|
|
$result = 'Wrong data or no validation for ' . $vids;
|
|
}
|
|
echo $result !== true ? json_encode($result) : '';
|
|
?>
|