need to call egw_json_request::isJSONRequest(true), before throwing an exception (or calling egw_json_request::parseRequest()), otherwise exception is not shown on client as alert

This commit is contained in:
Ralf Becker 2015-01-27 08:57:34 +00:00
parent 3f0d279704
commit 7a0662b529

View File

@ -100,6 +100,7 @@ if (isset($_GET['menuaction']))
//Check whether the request data is set //Check whether the request data is set
if (isset($GLOBALS['egw_unset_vars']['_POST[json_data]'])) if (isset($GLOBALS['egw_unset_vars']['_POST[json_data]']))
{ {
$json->isJSONRequest(true); // otherwise exception is not send back to client, as we have not yet called parseRequest()
throw new egw_exception_assertion_failed("JSON Data contains script tags. Aborting..."); throw new egw_exception_assertion_failed("JSON Data contains script tags. Aborting...");
} }
$json->parseRequest($_GET['menuaction'], $_REQUEST['json_data']); $json->parseRequest($_GET['menuaction'], $_REQUEST['json_data']);