Various fixes for php 32bits and long albums/photos ids

This commit is contained in:
Bocquet Aldric 2016-03-16 16:15:07 +01:00
parent dffce28eb4
commit 0ea5909ea4
2 changed files with 5 additions and 6 deletions

View File

@ -16,10 +16,9 @@ final class Response {
}
public static function json($str) {
exit(json_encode($str));
// JSON_NUMERIC_CHECK ensure the albums/photos ids will be converted from strings to integers
public static function json($str, $options = JSON_NUMERIC_CHECK) {
exit(json_encode($str, $options));
}
}

View File

@ -8,8 +8,8 @@ function generateID() {
// Ensure that the id has a length of 14 chars
while(strlen($id)<14) $id .= 0;
// Return the integer value of the id
return intval($id);
// Return id as a string (32bit php can't handle 14digit integers)
return $id;
}