From 78fc9a64bdd7fc1ac11c8718e097799236c0ba23 Mon Sep 17 00:00:00 2001
From: Marius Cramer <m.cramer@pixcept.de>
Date: Sun, 03 Nov 2013 07:23:46 -0500
Subject: [PATCH] Merge branch 'master' of /home/git/repositories/florian030/ispconfig3

---
 interface/lib/classes/json_handler.inc.php |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/interface/lib/classes/json_handler.inc.php b/interface/lib/classes/json_handler.inc.php
index d2acb22..9f34522 100644
--- a/interface/lib/classes/json_handler.inc.php
+++ b/interface/lib/classes/json_handler.inc.php
@@ -74,14 +74,19 @@
         $ret->code = $code;
         $ret->message = $message;
         $ret->response = $data;
-        header('Content-Type: application/x-json; charset="utf-8"');
+        
+        header('Content-Type: application/json; charset="utf-8"');
         print json_encode($ret);
         exit;
     }
     
     public function run() {
         
-        $method = reset(array_keys($_GET));
+        if(!isset($_GET) || !is_array($_GET) || count($_GET) < 1) {
+            $this->_return_json('invalid_method', 'Method not provided in json call');
+        }
+        $keys = array_keys($_GET);
+        $method = reset($keys);
         $params = array();
 
         if(is_array($_POST)) {

--
Gitblit v1.9.1