ajax.php
changeset 880 218b6d4de908
parent 870 82bbfe3dc8a0
child 963 b572ce1114f1
equal deleted inserted replaced
879:9788f2b7e08a 880:218b6d4de908
   185     case "savepage_json":
   185     case "savepage_json":
   186       header('Content-type: application/json');
   186       header('Content-type: application/json');
   187       if ( !isset($_POST['r']) )
   187       if ( !isset($_POST['r']) )
   188         die('Invalid request');
   188         die('Invalid request');
   189       
   189       
   190       $request = enano_json_decode($_POST['r']);
   190       try
   191       if ( !isset($request['src']) || !isset($request['summary']) || !isset($request['minor_edit']) || !isset($request['time']) || !isset($request['draft']) )
   191       {
   192         die('Invalid request');
   192         $request = enano_json_decode($_POST['r']);
       
   193         if ( !isset($request['src']) || !isset($request['summary']) || !isset($request['minor_edit']) || !isset($request['time']) || !isset($request['draft']) )
       
   194           die('Invalid request');
       
   195       }
       
   196       catch(Zend_Json_Exception $e)
       
   197       {
       
   198         die("JSON parsing failed. View as HTML to see full report.\n<br /><br />\n<pre>" . htmlspecialchars(strval($e)) . "</pre><br />Request: <pre>" . htmlspecialchars($_POST['r']) . "</pre>");
       
   199       }
   193       
   200       
   194       $time = intval($request['time']);
   201       $time = intval($request['time']);
   195       
   202       
   196       if ( $request['draft'] )
   203       if ( $request['draft'] )
   197       {
   204       {