3.3.5-rc1
[phpmyadmin/arisferyanto.git] / setup / validate.php
blob0d3bf461aecc0dbf1983465ab8fa21d2180c8966
1 <?php
2 /**
3 * Validation callback.
5 * @package phpMyAdmin-setup
6 * @author Piotr Przybylski <piotrprz@gmail.com>
7 * @copyright Copyright (c) 2008, Piotr Przybylski <piotrprz@gmail.com>
8 * @license http://www.gnu.org/licenses/gpl.html GNU GPL 2.0
9 * @version $Id$
12 /**
13 * Core libraries.
15 require './lib/common.inc.php';
17 $validators = array();
18 require './setup/lib/validate.lib.php';
20 header('Content-type: application/json');
22 $vids = explode(',', filter_input(INPUT_POST, 'id'));
23 $values = json_decode(filter_input(INPUT_POST, 'values'));
24 if (!($values instanceof stdClass)) {
25 die('Wrong data');
27 $values = (array)$values;
28 $result = validate($vids, $values, true);
29 if ($result === false) {
30 $result = 'Wrong data or no validation for ' . $vids;
32 echo $result !== true ? json_encode($result) : '';