Upgraded phpmyadmin to 4.0.4 (All Languages) - No modifications yet
[openemr.git] / phpmyadmin / setup / validate.php
blob2cb8c93ca8d0d3e9354dc916ee7a5275f0a74eb9
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * Validation callback.
6 * @package PhpMyAdmin-Setup
7 */
9 /**
10 * Core libraries.
12 require './lib/common.inc.php';
14 $validators = array();
15 require './libraries/config/validate.lib.php';
17 header('Content-type: application/json');
19 $vids = explode(',', filter_input(INPUT_POST, 'id'));
20 $values = json_decode(filter_input(INPUT_POST, 'values'));
21 if (!($values instanceof stdClass)) {
22 PMA_fatalError(__('Wrong data'));
24 $values = (array)$values;
25 $result = PMA_config_validate($vids, $values, true);
26 if ($result === false) {
27 $result = 'Wrong data or no validation for ' . $vids;
29 echo $result !== true ? json_encode($result) : '';