From 38798b872d5700543debeab533463ea7069e0a9a Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Sun, 25 Aug 2013 12:42:55 +0000 Subject: [PATCH] Force use of singleton: $response = egw_json_response::get(); not using it causes response being wrapped in an other response --- json.php | 4 ++-- phpgwapi/inc/class.egw_json.inc.php | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/json.php b/json.php index 3581ee2b85..02c6924f2d 100644 --- a/json.php +++ b/json.php @@ -18,7 +18,7 @@ */ function xajax_redirect(&$anon_account) { - $response = new egw_json_response(); + $response = egw_json_response::get(); $response->redirect($GLOBALS['egw_info']['server']['webserver_url'].'/login.php?cd=10', true); $response->printOutput(); @@ -39,7 +39,7 @@ function ajax_exception_handler(Exception $e) { _egw_log_exception($e,$message); } - $response = new egw_json_response(); + $response = egw_json_response::get(); $message .= ($message ? "\n\n" : '').$e->getMessage(); // only show trace (incl. function arguments) if explicitly enabled, eg. on a development system diff --git a/phpgwapi/inc/class.egw_json.inc.php b/phpgwapi/inc/class.egw_json.inc.php index 56ae6318a0..047b287eb7 100644 --- a/phpgwapi/inc/class.egw_json.inc.php +++ b/phpgwapi/inc/class.egw_json.inc.php @@ -183,6 +183,14 @@ class egw_json_response */ private static $response = null; + /** + * Force use of singleton: $response = egw_json_response::get(); + */ + private function __construct() + { + + } + /** * Singelton for class *