Skip to content

Commit 112be06

Browse files
author
Chris Raynor
committed
This fixes firebase#8 by checking if JSON_BIGINT_AS_STRING is defined and falling back to the pre 5.4 code path otherwise
1 parent 2f57086 commit 112be06

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Authentication/JWT.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ public static function sign($msg, $key, $method = 'HS256')
130130
*/
131131
public static function jsonDecode($input)
132132
{
133-
if (version_compare(PHP_VERSION, '5.4.0', '>=')) {
133+
if (version_compare(PHP_VERSION, '5.4.0', '>=') and defined('JSON_BIGINT_AS_STRING')) {
134134
/* In PHP >=5.4.0, json_decode() accepts an options parameter, that allows you to specify that large ints (like Steam
135135
* Transaction IDs) should be treated as strings, rather than the PHP default behaviour of converting them to floats.
136136
*/

0 commit comments

Comments
 (0)