commit 6ba8ff19b116aea2803dfc708964806bdfa44b04
parent 5a2466d0c4a7b0d8d0d8a6504a3368960ccbc701
Author: Jan Dankert <devnull@localhost>
Date: Mon, 17 Jul 2017 21:37:18 +0200
In ganz bestimmten Fällen mit ungültigen Unicode-Zeichen liefert json_encode() nichts zurück. Mit diesen Optionen wird erzwungen, dass immer ein JSON-Dokument zurückgegeben wird.
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/action/Action.class.php b/action/Action.class.php
@@ -408,7 +408,7 @@ class Action
header('Content-Type: application/json; charset=UTF-8');
if ( function_exists('json_encode'))
// Native Methode ist schneller..
- echo json_encode( $this->templateVars );
+ echo json_encode( $this->templateVars, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_NUMERIC_CHECK | JSON_PARTIAL_OUTPUT_ON_ERROR );
else
// Fallback, falls json_encode() nicht existiert...
echo $json->encode( $this->templateVars );