From cc511ac7b8c6aab3f6bea335d35b019554157b22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Fortier?= Date: Mon, 20 Feb 2017 22:07:37 -0500 Subject: [PATCH] Typecast filecache 'storage' as int to return it as documented, fixes #3461 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Frédéric Fortier --- apps/files_sharing/lib/SharedMount.php | 2 +- lib/private/Files/Cache/Cache.php | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/files_sharing/lib/SharedMount.php b/apps/files_sharing/lib/SharedMount.php index 2ef5e15b778..d5ae303390f 100644 --- a/apps/files_sharing/lib/SharedMount.php +++ b/apps/files_sharing/lib/SharedMount.php @@ -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; } diff --git a/lib/private/Files/Cache/Cache.php b/lib/private/Files/Cache/Cache.php index a966d621c58..689a3ad8096 100644 --- a/lib/private/Files/Cache/Cache.php +++ b/lib/private/Files/Cache/Cache.php @@ -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);