summaryrefslogtreecommitdiffstats
path: root/apps/files_trashbin/lib/trashbin.php
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-09-17 18:50:29 +0200
committerVincent Petry <pvince81@owncloud.com>2014-09-23 12:33:07 +0200
commit1e631754d78e98d74ba0d3fb477d5eb815e9dfb3 (patch)
tree05baebac1ea899e06571dce381c124f9fdbed37b /apps/files_trashbin/lib/trashbin.php
parent4669ea38357f3f33caaf056d859e6318b75b72e1 (diff)
downloadnextcloud-server-1e631754d78e98d74ba0d3fb477d5eb815e9dfb3.tar.gz
nextcloud-server-1e631754d78e98d74ba0d3fb477d5eb815e9dfb3.zip
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
Diffstat (limited to 'apps/files_trashbin/lib/trashbin.php')
-rw-r--r--apps/files_trashbin/lib/trashbin.php6
1 files changed, 1 insertions, 5 deletions
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);