diff options
author | Morris Jobke <hey@morrisjobke.de> | 2015-07-02 13:02:20 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2015-07-02 13:02:20 +0200 |
commit | f5c57e076ecf7b897a6f6bbea8f4de32e57cfba2 (patch) | |
tree | 31d4ca594624f780881dde3c50aa9e8dd0731c38 /lib | |
parent | aedf4848f7100360d1f6695ebf23733e85b3a729 (diff) | |
parent | 8a2ef26b5e8f2f8b4235263fb25c4d94d2f06647 (diff) | |
download | nextcloud-server-f5c57e076ecf7b897a6f6bbea8f4de32e57cfba2.tar.gz nextcloud-server-f5c57e076ecf7b897a6f6bbea8f4de32e57cfba2.zip |
Merge pull request #17077 from owncloud/files-scan-absolute-path
fix getting mount points when passing a path to the files:scan command
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/files/config/mountprovidercollection.php | 10 | ||||
-rw-r--r-- | lib/private/files/utils/scanner.php | 5 |
2 files changed, 10 insertions, 5 deletions
diff --git a/lib/private/files/config/mountprovidercollection.php b/lib/private/files/config/mountprovidercollection.php index a14a6ef796f..c75c64ae445 100644 --- a/lib/private/files/config/mountprovidercollection.php +++ b/lib/private/files/config/mountprovidercollection.php @@ -57,8 +57,14 @@ class MountProviderCollection implements IMountProviderCollection, Emitter { */ public function getMountsForUser(IUser $user) { $loader = $this->loader; - return array_reduce($this->providers, function ($mounts, IMountProvider $provider) use ($user, $loader) { - return array_merge($mounts, $provider->getMountsForUser($user, $loader)); + $mounts = array_map(function (IMountProvider $provider) use ($user, $loader) { + return $provider->getMountsForUser($user, $loader); + }, $this->providers); + $mounts = array_filter($mounts, function ($result) { + return is_array($result); + }); + return array_reduce($mounts, function (array $mounts, array $providerMounts) { + return array_merge($mounts, $providerMounts); }, array()); } diff --git a/lib/private/files/utils/scanner.php b/lib/private/files/utils/scanner.php index 23a9e26b3bc..3d68eb530a2 100644 --- a/lib/private/files/utils/scanner.php +++ b/lib/private/files/utils/scanner.php @@ -76,11 +76,10 @@ class Scanner extends PublicEmitter { //TODO: move to the node based fileapi once that's done \OC_Util::tearDownFS(); \OC_Util::setupFS($this->user); - $absolutePath = Filesystem::getView()->getAbsolutePath($dir); $mountManager = Filesystem::getMountManager(); - $mounts = $mountManager->findIn($absolutePath); - $mounts[] = $mountManager->find($absolutePath); + $mounts = $mountManager->findIn($dir); + $mounts[] = $mountManager->find($dir); $mounts = array_reverse($mounts); //start with the mount of $dir return $mounts; |