diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/files/mount.php | 26 | ||||
-rw-r--r-- | lib/files/view.php | 2 | ||||
-rw-r--r-- | lib/public/share.php | 2 |
3 files changed, 26 insertions, 4 deletions
diff --git a/lib/files/mount.php b/lib/files/mount.php index 6e99d8eabb4..1c9382d78e7 100644 --- a/lib/files/mount.php +++ b/lib/files/mount.php @@ -176,10 +176,12 @@ class Mount { } /** + * Find mounts by storage id + * * @param string $id - * @return \OC\Files\Storage\Storage[] + * @return Mount[] */ - public static function findById($id) { + public static function findByStorageId($id) { if (strlen($id) > 64) { $id = md5($id); } @@ -191,4 +193,24 @@ class Mount { } return $result; } + + /** + * Find mounts by numeric storage id + * + * @param string $id + * @return Mount + */ + public static function findByNumericId($id) { + $query = \OC_DB::prepare('SELECT `id` FROM `*PREFIX*storages` WHERE `numeric_id` = ?'); + $result = $query->execute(array($id))->fetchOne(); + if ($result) { + $id = $result; + foreach (self::$mounts as $mount) { + if ($mount->getStorageId() === $id) { + return $mount; + } + } + } + return false; + } } diff --git a/lib/files/view.php b/lib/files/view.php index 3e2cb080e1d..4ed3234552e 100644 --- a/lib/files/view.php +++ b/lib/files/view.php @@ -960,7 +960,7 @@ class View { */ public function getPath($id) { list($storage, $internalPath) = Cache\Cache::getById($id); - $mounts = Mount::findById($storage); + $mounts = Mount::findByStorageId($storage); foreach ($mounts as $mount) { /** * @var \OC\Files\Mount $mount diff --git a/lib/public/share.php b/lib/public/share.php index 8146a23f360..59f41a9bfd6 100644 --- a/lib/public/share.php +++ b/lib/public/share.php @@ -786,7 +786,7 @@ class Share { } else { $select = '`*PREFIX*share`.`id`, `item_type`, `item_source`, `item_target`, `*PREFIX*share`.`parent`, `share_type`, `share_with`, `uid_owner`, - `file_source`, `path`, `file_target`, `permissions`, `stime`, `expiration`, `token`'; + `file_source`, `path`, `file_target`, `permissions`, `stime`, `expiration`, `token`, `storage`'; } } else { $select = '*'; |