summaryrefslogtreecommitdiffstats
path: root/apps/files_encryption/hooks
diff options
context:
space:
mode:
authorBjörn Schießle <schiessle@owncloud.com>2013-06-25 16:50:10 +0200
committerBjörn Schießle <schiessle@owncloud.com>2013-07-05 16:00:17 +0200
commitf9c337dd2149248be717f870bdba79ac21868bbe (patch)
treeefa7b3c484b92eec19304275a9419973baace767 /apps/files_encryption/hooks
parent93730a090be9587a5b6c52fe52afaba0a48be1e9 (diff)
downloadnextcloud-server-f9c337dd2149248be717f870bdba79ac21868bbe.tar.gz
nextcloud-server-f9c337dd2149248be717f870bdba79ac21868bbe.zip
only escape glob pattern
Diffstat (limited to 'apps/files_encryption/hooks')
-rw-r--r--apps/files_encryption/hooks/hooks.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/apps/files_encryption/hooks/hooks.php b/apps/files_encryption/hooks/hooks.php
index 96f06b154f8..c26119b6c2e 100644
--- a/apps/files_encryption/hooks/hooks.php
+++ b/apps/files_encryption/hooks/hooks.php
@@ -497,7 +497,8 @@ class Hooks {
// handle share-keys
$localKeyPath = $view->getLocalFile($baseDir . 'share-keys/' . $params['oldpath']);
- $matches = glob(preg_quote($localKeyPath) . '*.shareKey');
+ $escapedPath = preg_replace('/(\*|\?|\[)/', '[$1]', $localKeyPath);
+ $matches = glob($escapedPath . '*.shareKey');
foreach ($matches as $src) {
$dst = \OC\Files\Filesystem::normalizePath(str_replace($params['oldpath'], $params['newpath'], $src));