From 1e631754d78e98d74ba0d3fb477d5eb815e9dfb3 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Wed, 17 Sep 2014 18:50:29 +0200 Subject: Fix share key finding algorithm in various cases Instead of inaccurate pattern matching, use the list of users who we know have access to the file to build the list of share keys. This covers the following cases: - Move/copy files into a subfolder within a share - Unsharing from a user - Deleting files directlry / moving share keys to trashbin --- apps/files_trashbin/lib/trashbin.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'apps/files_trashbin') diff --git a/apps/files_trashbin/lib/trashbin.php b/apps/files_trashbin/lib/trashbin.php index 5f1226d89d8..6be635ef0d0 100644 --- a/apps/files_trashbin/lib/trashbin.php +++ b/apps/files_trashbin/lib/trashbin.php @@ -303,12 +303,8 @@ class Trashbin { } $rootView->rename($sharekeys, $user . '/files_trashbin/share-keys/' . $filename . '.d' . $timestamp); } else { - // get local path to share-keys - $localShareKeysPath = $rootView->getLocalFile($sharekeys); - $escapedLocalShareKeysPath = preg_replace('/(\*|\?|\[)/', '[$1]', $localShareKeysPath); - // handle share-keys - $matches = glob($escapedLocalShareKeysPath . '*.shareKey'); + $matches = \OCA\Encryption\Helper::findShareKeys($ownerPath, $sharekeys, $rootView); foreach ($matches as $src) { // get source file parts $pathinfo = pathinfo($src); -- cgit v1.2.3