aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_encryption/hooks/hooks.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_encryption/hooks/hooks.php')
-rw-r--r--apps/files_encryption/hooks/hooks.php23
1 files changed, 13 insertions, 10 deletions
diff --git a/apps/files_encryption/hooks/hooks.php b/apps/files_encryption/hooks/hooks.php
index 743593d798a..d1b08a0b978 100644
--- a/apps/files_encryption/hooks/hooks.php
+++ b/apps/files_encryption/hooks/hooks.php
@@ -332,6 +332,12 @@ class Hooks {
$sharingEnabled = \OCP\Share::isEnabled();
+ // get the path including mount point only if not a shared folder
+ if(strncmp($path, '/Shared' , strlen('/Shared') !== 0)) {
+ // get path including the the storage mount point
+ $path = $util->getPathWithMountPoint($params['itemSource']);
+ }
+
// if a folder was shared, get a list of all (sub-)folders
if ($params['itemType'] === 'folder') {
$allFiles = $util->getAllFiles($path);
@@ -381,17 +387,11 @@ class Hooks {
// rebuild path
foreach ($targetPathSplit as $pathPart) {
-
if ($pathPart !== $sharedPart) {
-
$path = '/' . $pathPart . $path;
-
} else {
-
break;
-
}
-
}
// prefix path with Shared
@@ -409,13 +409,16 @@ class Hooks {
}
}
+ // get the path including mount point only if not a shared folder
+ if(strncmp($path, '/Shared' , strlen('/Shared') !== 0)) {
+ // get path including the the storage mount point
+ $path = $util->getPathWithMountPoint($params['itemSource']);
+ }
+
// if we unshare a folder we need a list of all (sub-)files
if ($params['itemType'] === 'folder') {
-
- $allFiles = $util->getAllFiles($path);
-
+ $allFiles = $util->getAllFiles( $path );
} else {
-
$allFiles = array($path);
}