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 *