Skip to content

Commit 713523c

Browse files
author
Mark Railton
authored
Merge pull request #441 from exussum12/jsonBigInts
Fix for allowing big ints
2 parents 367879e + 80add74 commit 713523c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/controllers/FacebookController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public function logUserIn(Request $request, PDO $db)
6767
]
6868
]);
6969
if ($res->getStatusCode() == 200) {
70-
$data = json_decode((string)$res->getBody(), true);
70+
$data = json_decode((string)$res->getBody(), true, 512, JSON_BIGINT_AS_STRING);
7171
if (!array_key_exists('email', $data)) {
7272
throw new Exception("Email address is unavailable", 403);
7373
}

src/views/JsonView.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ protected function numericCheck($data)
4949

5050
protected function scalarNumericCheck($key, $value)
5151
{
52-
if (is_numeric($value) && ! in_array($key, $this->string_fields)) {
52+
if (is_numeric($value) && ! in_array($key, $this->string_fields) && $value < PHP_INT_MAX) {
5353
return (float) $value;
5454
}
5555

0 commit comments

Comments
 (0)