aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2019-05-29 21:56:15 +0200
committerGitHub <noreply@github.com>2019-05-29 21:56:15 +0200
commit58fe0b8032a78fd7dc68d21c7b84bab089566f18 (patch)
tree0c9639dcb39809bbe696473a46b642333aa593b2 /lib
parent96b15dd1017dac5639752be25f97069fac8b1dee (diff)
parent98dd526010c4ccc66ac69cf90bc300984fb8f2de (diff)
downloadnextcloud-server-58fe0b8032a78fd7dc68d21c7b84bab089566f18.tar.gz
nextcloud-server-58fe0b8032a78fd7dc68d21c7b84bab089566f18.zip
Merge pull request #15776 from nextcloud/get-by-id-shares-last
search files by id in shared storages last
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Files/View.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/private/Files/View.php b/lib/private/Files/View.php
index fa531707648..fef6153fb9a 100644
--- a/lib/private/Files/View.php
+++ b/lib/private/Files/View.php
@@ -49,6 +49,7 @@ use Icewind\Streams\CallbackWrapper;
use OC\Files\Mount\MoveableMount;
use OC\Files\Storage\Storage;
use OC\User\User;
+use OCA\Files_Sharing\SharedMount;
use OCP\Constants;
use OCP\Files\Cache\ICacheEntry;
use OCP\Files\EmptyFileNameException;
@@ -1718,6 +1719,13 @@ class View {
// reverse the array so we start with the storage this view is in
// which is the most likely to contain the file we're looking for
$mounts = array_reverse($mounts);
+
+ // put non shared mounts in front of the shared mount
+ // this prevent unneeded recursion into shares
+ usort($mounts, function(IMountPoint $a, IMountPoint $b) {
+ return $a instanceof SharedMount && (!$b instanceof SharedMount) ? 1 : -1;
+ });
+
foreach ($mounts as $mount) {
/**
* @var \OC\Files\Mount\MountPoint $mount