diff --git a/e107_handlers/js_helper.php b/e107_handlers/js_helper.php index 7a8446d2e..e95cada3f 100644 --- a/e107_handlers/js_helper.php +++ b/e107_handlers/js_helper.php @@ -182,7 +182,7 @@ class e_jshelper $this->addResponseAction($action, $data_array); } - echo $this->buildXmlResponse(); + if(null !== $action) echo $this->buildXmlResponse(); exit; } @@ -191,8 +191,9 @@ class e_jshelper * * @return string JSON response */ - function buildJsonResponse() + function buildJsonResponse($data = null) { + if(null !== $data) return "/*-secure-\n".json_encode($data)."\n*/"; return "/*-secure-\n".json_encode($this->getResponseActions(true))."\n*/"; } @@ -209,7 +210,7 @@ class e_jshelper { $this->addResponseAction($action, $data_array); } - echo $this->buildJSONResponse(); + if(null !== $action) echo $this->buildJSONResponse(); exit; }