From: Arthur Schiwon Date: Tue, 28 Mar 2023 11:48:43 +0000 (+0200) Subject: hide shared files located in group folder's trash bin X-Git-Tag: v24.0.12rc1~18^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=refs%2Fpull%2F37493%2Fhead;p=nextcloud-server.git hide shared files located in group folder's trash bin Signed-off-by: Arthur Schiwon --- diff --git a/lib/private/Share20/DefaultShareProvider.php b/lib/private/Share20/DefaultShareProvider.php index 5ce444942f3..ef1f1465ba3 100644 --- a/lib/private/Share20/DefaultShareProvider.php +++ b/lib/private/Share20/DefaultShareProvider.php @@ -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 @@ -864,6 +865,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; }