Merge pull request #15800 from nextcloud/backport/15776/stable15

[stable15] search files by id in shared storages last
This commit is contained in:
Morris Jobke 2019-05-31 13:30:10 +02:00 committed by GitHub
commit 925e121097
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -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;
@ -1715,6 +1716,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