summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Raynor <chris@firebase.com>2014-06-20 12:26:34 -0700
committerChris Raynor <chris@firebase.com>2014-06-20 12:26:34 -0700
commit112be061b5c8ff4547b4127ededd2dd9eee749c1 (patch)
tree6dcbcf3b9d932a5bdb0b8529dcc47a299b32f5f2
parent2f570864b60233334039de052bf4baff459e0dee (diff)
downloadphp-jwt-112be061b5c8ff4547b4127ededd2dd9eee749c1.zip
php-jwt-112be061b5c8ff4547b4127ededd2dd9eee749c1.tar.gz
php-jwt-112be061b5c8ff4547b4127ededd2dd9eee749c1.tar.bz2
This fixes #8 by checking if JSON_BIGINT_AS_STRING is defined and falling back to the pre 5.4 code path otherwise
-rw-r--r--Authentication/JWT.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/Authentication/JWT.php b/Authentication/JWT.php
index cd72a74..0d226f4 100644
--- a/Authentication/JWT.php
+++ b/Authentication/JWT.php
@@ -130,7 +130,7 @@ class JWT
*/
public static function jsonDecode($input)
{
- if (version_compare(PHP_VERSION, '5.4.0', '>=')) {
+ if (version_compare(PHP_VERSION, '5.4.0', '>=') and defined('JSON_BIGINT_AS_STRING')) {
/* In PHP >=5.4.0, json_decode() accepts an options parameter, that allows you to specify that large ints (like Steam
* Transaction IDs) should be treated as strings, rather than the PHP default behaviour of converting them to floats.
*/