Filesystem: use the updated Mount::findById in getPath to ensure we get the correct path if the storage is also mounted outside the view

This commit is contained in:
Robin Appelman 2013-01-28 01:02:04 +01:00
parent 577e3b11d7
commit 3e59a87153
1 changed files with 11 additions and 3 deletions

View File

@ -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;
}
}