From: Riton Date: Sat, 4 Sep 2010 14:54:49 +0000 (+0200) Subject: Inserted a pl_error field in the json responses X-Git-Tag: core/1.1.1~35 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=641802fe13bbd3812e39a0151392179eba580162;p=platal.git Inserted a pl_error field in the json responses Signed-off-by: Riton Signed-off-by: Florent Bruneau --- diff --git a/classes/plpage.php b/classes/plpage.php index a38a076..63ece95 100644 --- a/classes/plpage.php +++ b/classes/plpage.php @@ -370,6 +370,10 @@ abstract class PlPage extends Smarty protected function jsonDisplay() { pl_content_headers("text/javascript"); + if (!empty($GLOBALS['pl_errors'])) { + $this->jsonAssign('pl_errors', join("\n", $GLOBALS['pl_errors'])); + $GLOBALS['pl_errors'] = array(); + } array_walk_recursive($this->_jsonVars, "escape_xorgDB"); $jsonbegin = Env::v('jsonBegin'); $jsonend = Env::v('jsonEnd');