openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 192ba076b97ee72db431cab7de0c7a9ad3d4c8dc
parent b5e176d54f0cb3a0305cc773f6afb532cacdc9c4
Author: Jan Dankert <devnull@localhost>
Date:   Thu,  6 Sep 2018 01:20:59 +0200

Konstante JSON_PARTIAL_OUTPUT_ON_ERROR ist erst ab PHP 5.5 verfügbar.

Diffstat:
modules/cms-api/API.class.php | 7++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/modules/cms-api/API.class.php b/modules/cms-api/API.class.php @@ -88,7 +88,12 @@ class API if (function_exists('json_encode')) { // Native Methode ist schneller.. - $output = json_encode($data, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_NUMERIC_CHECK | JSON_PARTIAL_OUTPUT_ON_ERROR); + if ( version_compare(PHP_VERSION, '5.5', '>=' ) ) + $jsonOptions = JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_NUMERIC_CHECK | JSON_PARTIAL_OUTPUT_ON_ERROR; + else + $jsonOptions = JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_NUMERIC_CHECK; + + $output = json_encode($data, $jsonOptions); } else {