From 4e85a426a4af6f64292abf315aad8fc7a12b0cee Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Mon, 1 Jun 2015 14:08:14 +0200 Subject: emit hooks from a view as long as the path is inside the default root --- lib/private/files/view.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/private/files/view.php b/lib/private/files/view.php index b07225cca56..ae1cb8913a5 100644 --- a/lib/private/files/view.php +++ b/lib/private/files/view.php @@ -898,7 +898,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 . '/'); } /** -- cgit v1.2.3 From a9a5ac2fd17a72ea87ed00d15131048ec1ebf607 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Mon, 15 Jun 2015 15:07:48 +0200 Subject: fix check if hooks should be emited in runHooks --- lib/private/files/view.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/private/files/view.php b/lib/private/files/view.php index ae1cb8913a5..1ad59fd9123 100644 --- a/lib/private/files/view.php +++ b/lib/private/files/view.php @@ -909,10 +909,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( -- cgit v1.2.3