]> source.dussan.org Git - nextcloud-server.git/commitdiff
Typecast filecache 'storage' as int to return it as documented, fixes #3461
authorFrédéric Fortier <frederic.fortier@oronospolytechnique.com>
Tue, 21 Feb 2017 03:07:37 +0000 (22:07 -0500)
committerApache <frederic.fortier@oronospolytechnique.com>
Tue, 21 Feb 2017 03:23:27 +0000 (22:23 -0500)
Signed-off-by: Frédéric Fortier <frederic.fortier@oronospolytechnique.com>
apps/files_sharing/lib/SharedMount.php
lib/private/Files/Cache/Cache.php

index 2ef5e15b7782a78bb23a28ba86e3edd26b8f78d4..d5ae303390f64b37e00262f542c14c3f6e1cd898 100644 (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;
                }
index a966d621c58d4e617c461b2545b24ff1e250a0af..689a3ad8096badfc22d9e12fba651bd13dede03e 100644 (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);