Merge branch 'master' of git://phpmyadmin.git.sourceforge.net/gitroot/phpmyadmin...
[phpmyadmin/lorilee.git] / setup / validate.php
blob68781bc982792e9a30c10c85d948950b91098810
1 <?php
2 /**
3 * Validation callback.
5 * @package phpMyAdmin-setup
6 * @copyright Copyright (c) 2008, Piotr Przybylski <piotrprz@gmail.com>
7 * @license http://www.gnu.org/licenses/gpl.html GNU GPL 2.0
8 * @version $Id$
9 */
11 /**
12 * Core libraries.
14 require './lib/common.inc.php';
16 $validators = array();
17 require './setup/lib/validate.lib.php';
19 header('Content-type: application/json');
21 $vids = explode(',', filter_input(INPUT_POST, 'id'));
22 $values = json_decode(filter_input(INPUT_POST, 'values'));
23 if (!($values instanceof stdClass)) {
24 die('Wrong data');
26 $values = (array)$values;
27 $result = validate($vids, $values, true);
28 if ($result === false) {
29 $result = 'Wrong data or no validation for ' . $vids;
31 echo $result !== true ? json_encode($result) : '';