]> source.dussan.org Git - nextcloud-server.git/commitdiff
hide shared files located in group folder's trash bin 37488/head
authorArthur Schiwon <blizzz@arthur-schiwon.de>
Tue, 28 Mar 2023 11:48:43 +0000 (13:48 +0200)
committerArthur Schiwon <blizzz@arthur-schiwon.de>
Thu, 30 Mar 2023 15:02:26 +0000 (17:02 +0200)
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
lib/private/Share20/DefaultShareProvider.php

index 215b47344b5b41cf2a5f549044a1199b1a98cd2d..9dd862abb3175022552539e92ca58f78514ccb4c 100644 (file)
@@ -55,6 +55,7 @@ use OCP\Share\Exceptions\ShareNotFound;
 use OCP\Share\IAttributes;
 use OCP\Share\IShare;
 use OCP\Share\IShareProvider;
+use function str_starts_with;
 
 /**
  * Class DefaultShareProvider
@@ -885,6 +886,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;
        }