Typecast filecache 'storage' as int to return it as documented, fixes #3461

Signed-off-by: Frédéric Fortier <frederic.fortier@oronospolytechnique.com>
This commit is contained in:
Frédéric Fortier 2017-02-20 22:07:37 -05:00
parent cd270b8e7e
commit 0f3cf7fee8
2 changed files with 3 additions and 1 deletions

View File

@ -253,7 +253,7 @@ class SharedMount extends MountPoint implements MoveableMount {
$row = $result->fetch();
$result->closeCursor();
if ($row) {
return $row['storage'];
return (int)$row['storage'];
}
return -1;
}

View File

@ -163,6 +163,7 @@ class Cache implements ICache {
$data['encryptedVersion'] = (int)$data['encrypted'];
$data['encrypted'] = (bool)$data['encrypted'];
$data['storage_id'] = $data['storage'];
$data['storage'] = (int)$data['storage'];
$data['mimetype'] = $mimetypeLoader->getMimetypeById($data['mimetype']);
$data['mimepart'] = $mimetypeLoader->getMimetypeById($data['mimepart']);
if ($data['storage_mtime'] == 0) {
@ -206,6 +207,7 @@ class Cache implements ICache {
$file['mtime'] = (int)$file['mtime'];
$file['storage_mtime'] = (int)$file['storage_mtime'];
$file['size'] = 0 + $file['size'];
$file['storage'] = (int)$file['storage'];
}
return array_map(function (array $data) {
return new CacheEntry($data);