Fixed long albums/photos ids for 32bit PHP versions #487
This commit is contained in:
parent
9c1bab29f1
commit
c6d8b5f312
@ -93,7 +93,7 @@ final class Admin extends Access {
|
||||
Validator::required(isset($_POST['title']), __METHOD__);
|
||||
|
||||
$album = new Album(null);
|
||||
Response::json($album->add($_POST['title']));
|
||||
Response::json($album->add($_POST['title']), JSON_NUMERIC_CHECK);
|
||||
|
||||
}
|
||||
|
||||
|
@ -16,9 +16,9 @@ final class Response {
|
||||
|
||||
}
|
||||
|
||||
public static function json($str) {
|
||||
public static function json($str, $options = 0) {
|
||||
|
||||
exit(json_encode($str));
|
||||
exit(json_encode($str, $options));
|
||||
|
||||
}
|
||||
|
||||
|
@ -8,8 +8,9 @@ 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. Don't convert the id to an integer
|
||||
// as 14 digits are too big for 32bit PHP versions.
|
||||
return $id;
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user