Skip to content

Commit

Permalink
Check PHP version before calling json_decode with $options parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
kemo committed Apr 2, 2012
1 parent c699710 commit 3a7438e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion classes/Kohana/JSend.php
Expand Up @@ -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);
}
Expand Down

0 comments on commit 3a7438e

Please sign in to comment.