aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-06-22 11:29:11 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2015-06-22 11:29:11 +0200
commitced15c44b41d3fbaf506d28c506e2db75e57b774 (patch)
tree2f63c9a4c57f5ffbc77d8419e0141cf3ef54e7b1 /lib
parent7fe5ab4d4a43efb0384e59012fa1934acae7d6dc (diff)
parent567df226e50d372374fa15297c457c7fb2ba3306 (diff)
downloadnextcloud-server-ced15c44b41d3fbaf506d28c506e2db75e57b774.tar.gz
nextcloud-server-ced15c44b41d3fbaf506d28c506e2db75e57b774.zip
Merge pull request #16657 from owncloud/view-emit-path
emit hooks from a view as long as the path is inside the default root
Diffstat (limited to 'lib')
-rw-r--r--lib/private/files/view.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/private/files/view.php b/lib/private/files/view.php
index 47cbf35836c..73daf8a141f 100644
--- a/lib/private/files/view.php
+++ b/lib/private/files/view.php
@@ -1081,7 +1081,8 @@ class View {
if ($this->fakeRoot === $defaultRoot) {
return true;
}
- return (strlen($this->fakeRoot) > strlen($defaultRoot)) && (substr($this->fakeRoot, 0, strlen($defaultRoot) + 1) === $defaultRoot . '/');
+ $fullPath = $this->getAbsolutePath($path);
+ return (strlen($fullPath) > strlen($defaultRoot)) && (substr($fullPath, 0, strlen($defaultRoot) + 1) === $defaultRoot . '/');
}
/**
@@ -1091,10 +1092,11 @@ class View {
* @return bool
*/
private function runHooks($hooks, $path, $post = false) {
+ $relativePath = $path;
$path = $this->getHookPath($path);
$prefix = ($post) ? 'post_' : '';
$run = true;
- if ($this->shouldEmitHooks($path)) {
+ if ($this->shouldEmitHooks($relativePath)) {
foreach ($hooks as $hook) {
if ($hook != 'read') {
\OC_Hook::emit(