From 5c5a8a0ebac2a130d655c690818f58048bfb3a12 Mon Sep 17 00:00:00 2001 From: Björn Schießle Date: Tue, 25 Jun 2013 16:50:10 +0200 Subject: only escape glob pattern --- apps/files_encryption/hooks/hooks.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'apps/files_encryption/hooks/hooks.php') 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)); -- cgit v1.2.3