Merge pull request #37494 from nextcloud/backport/37448/stable23

[stable23] hide shared files located in group folder's trash bin
This commit is contained in:
Arthur Schiwon 2023-04-03 14:50:33 +02:00 committed by GitHub
commit e25fdb62e9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -54,6 +54,7 @@ use OCP\Mail\IMailer;
use OCP\Share\Exceptions\ShareNotFound;
use OCP\Share\IShare;
use OCP\Share\IShareProvider;
use function str_starts_with;
/**
* Class DefaultShareProvider
@ -840,6 +841,11 @@ class DefaultShareProvider implements IShareProvider {
if ($pathSections[0] !== 'files'
&& (strpos($data['storage_string_id'], 'home::') === 0 || strpos($data['storage_string_id'], 'object::user') === 0)) {
return false;
} elseif ($pathSections[0] === '__groupfolders'
&& str_starts_with($pathSections[1], 'trash/')
) {
// exclude shares leading to trashbin on group folders storages
return false;
}
return true;
}