From 3a7438ed57e1abcb1e4bd38d893e9514bb0deb5d Mon Sep 17 00:00:00 2001 From: Kemal Delalic Date: Mon, 2 Apr 2012 14:27:12 +0200 Subject: [PATCH] Check PHP version before calling json_decode with $options parameter --- classes/Kohana/JSend.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/classes/Kohana/JSend.php b/classes/Kohana/JSend.php index c59e775..7c1dc08 100644 --- a/classes/Kohana/JSend.php +++ b/classes/Kohana/JSend.php @@ -72,7 +72,9 @@ public static function decode($json, $assoc = NULL, $depth = NULL, $options = NU $options = JSend::DEFAULT_OPTIONS; } - $result = json_decode($json, $assoc, $depth, $options); + $result = version_compare(PHP_VERSION, '5.4') < 0 + ? json_decode($json, $assoc, $depth, $options) + : json_decode($json, $assoc, $depth); return JSend::check_json_errors($result); }