diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/files/view.php | 6 | ||||
-rw-r--r-- | lib/private/server.php | 2 | ||||
-rw-r--r-- | lib/private/share/hooks.php | 4 |
3 files changed, 8 insertions, 4 deletions
diff --git a/lib/private/files/view.php b/lib/private/files/view.php index b07225cca56..1ad59fd9123 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 . '/'); } /** @@ -908,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( diff --git a/lib/private/server.php b/lib/private/server.php index 957de1450b2..452a9ff489e 100644 --- a/lib/private/server.php +++ b/lib/private/server.php @@ -122,6 +122,8 @@ class Server extends SimpleContainer implements IServerContainer { }); $groupManager->listen('\OC\Group', 'postAddUser', function (\OC\Group\Group $group, \OC\User\User $user) { \OC_Hook::emit('OC_Group', 'post_addToGroup', array('uid' => $user->getUID(), 'gid' => $group->getGID())); + //Minimal fix to keep it backward compatible TODO: clean up all the GroupManager hooks + \OC_Hook::emit('OC_User', 'post_addToGroup', array('uid' => $user->getUID(), 'gid' => $group->getGID())); }); return $groupManager; }); diff --git a/lib/private/share/hooks.php b/lib/private/share/hooks.php index 66b197b921b..3cf5ceb1177 100644 --- a/lib/private/share/hooks.php +++ b/lib/private/share/hooks.php @@ -61,12 +61,12 @@ class Hooks extends \OC\Share\Constants { $itemTarget = $sourceExists['item_target']; } else { $itemTarget = Helper::generateTarget($item['item_type'], $item['item_source'], self::SHARE_TYPE_USER, $arguments['uid'], - $item['owner'], null, $item['parent']); + $item['uid_owner'], null, $item['parent']); // do we also need a file target if ($item['item_type'] === 'file' || $item['item_type'] === 'folder') { $fileTarget = Helper::generateTarget('file', $item['file_target'], self::SHARE_TYPE_USER, $arguments['uid'], - $item['owner'], null, $item['parent']); + $item['uid_owner'], null, $item['parent']); } else { $fileTarget = null; } |