diff options
author | Robin Appelman <icewind@owncloud.com> | 2015-01-26 14:34:40 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2015-01-28 13:44:39 +0100 |
commit | 8c9f1a982c48db4601ea7ba33b31fca342e03ded (patch) | |
tree | 29b2e085fb0c3dfefdd5dce2c4002cc342b04ccb /lib/private/files/view.php | |
parent | 55142186deb9e163ce3519453ebfe93f6a446666 (diff) | |
download | nextcloud-server-8c9f1a982c48db4601ea7ba33b31fca342e03ded.tar.gz nextcloud-server-8c9f1a982c48db4601ea7ba33b31fca342e03ded.zip |
Update the cache when renaming even if we dont emit hooks
Diffstat (limited to 'lib/private/files/view.php')
-rw-r--r-- | lib/private/files/view.php | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/lib/private/files/view.php b/lib/private/files/view.php index 096d8044b75..a2717ce4321 100644 --- a/lib/private/files/view.php +++ b/lib/private/files/view.php @@ -537,16 +537,18 @@ class View { if ($this->shouldEmitHooks()) { $this->emit_file_hooks_post($exists, $path2); } - } elseif ($this->shouldEmitHooks() && $result !== false) { + } elseif ($result !== false) { $this->updater->rename($path1, $path2); - \OC_Hook::emit( - Filesystem::CLASSNAME, - Filesystem::signal_post_rename, - array( - Filesystem::signal_param_oldpath => $this->getHookPath($path1), - Filesystem::signal_param_newpath => $this->getHookPath($path2) - ) - ); + if ($this->shouldEmitHooks($path1) and $this->shouldEmitHooks($path2)) { + \OC_Hook::emit( + Filesystem::CLASSNAME, + Filesystem::signal_post_rename, + array( + Filesystem::signal_param_oldpath => $this->getHookPath($path1), + Filesystem::signal_param_newpath => $this->getHookPath($path2) + ) + ); + } } return $result; } else { @@ -1315,7 +1317,7 @@ class View { $maxLen = min(PHP_MAXPATHLEN, 4000); // Check for the string length - performed using isset() instead of strlen() // because isset() is about 5x-40x faster. - if(isset($path[$maxLen])) { + if (isset($path[$maxLen])) { $pathLen = strlen($path); throw new \OCP\Files\InvalidPathException("Path length($pathLen) exceeds max path length($maxLen): $path"); } @@ -1351,7 +1353,7 @@ class View { * @return \OCP\Files\FileInfo */ private function getPartFileInfo($path) { - $mount = $this->getMount($path); + $mount = $this->getMount($path); $storage = $mount->getStorage(); $internalPath = $mount->getInternalPath($this->getAbsolutePath($path)); return new FileInfo( |