summaryrefslogtreecommitdiffstats
path: root/lib/files
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2013-01-28 01:02:04 +0100
committerRobin Appelman <icewind@owncloud.com>2013-01-28 01:02:04 +0100
commit3e59a8715390d659b433797c8a0ed080518e5e7d (patch)
tree09f0a5f9f6300bc10e27b70c468e515f379115f8 /lib/files
parent577e3b11d7b486d09334f39215814638704e84b9 (diff)
downloadnextcloud-server-3e59a8715390d659b433797c8a0ed080518e5e7d.tar.gz
nextcloud-server-3e59a8715390d659b433797c8a0ed080518e5e7d.zip
Filesystem: use the updated Mount::findById in getPath to ensure we get the correct path if the storage is also mounted outside the view
Diffstat (limited to 'lib/files')
-rw-r--r--lib/files/view.php14
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/files/view.php b/lib/files/view.php
index c2038f222a0..302232b5134 100644
--- a/lib/files/view.php
+++ b/lib/files/view.php
@@ -943,8 +943,16 @@ class View {
*/
public function getPath($id) {
list($storage, $internalPath) = Cache\Cache::getById($id);
- $mount = Mount::findById($storage);
- $fullPath = $mount->getMountPoint() . $internalPath;
- return $this->getRelativePath($fullPath);
+ $mounts = Mount::findById($storage);
+ foreach ($mounts as $mount) {
+ /**
+ * @var \OC\Files\Mount $mount
+ */
+ $fullPath = $mount->getMountPoint() . $internalPath;
+ if (!is_null($path = $this->getRelativePath($fullPath))) {
+ return $path;
+ }
+ }
+ return null;
}
}