summaryrefslogtreecommitdiffstats
path: root/lib/private/files
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2015-07-28 15:24:46 +0200
committerBjoern Schiessle <schiessle@owncloud.com>2015-07-29 11:02:38 +0200
commitfb4c99fe0671c8eaff1f1024d71b9d7a12968e8e (patch)
tree5262a731ed9d3fc422cd12286606e0dee687fb75 /lib/private/files
parentc34e63bb1f9752892d3c36b50e461b284f822a36 (diff)
downloadnextcloud-server-fb4c99fe0671c8eaff1f1024d71b9d7a12968e8e.tar.gz
nextcloud-server-fb4c99fe0671c8eaff1f1024d71b9d7a12968e8e.zip
make sure that we emit the hooks if a file gets moved from a subfolder to the root folder with the nodes API
Diffstat (limited to 'lib/private/files')
-rw-r--r--lib/private/files/view.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/private/files/view.php b/lib/private/files/view.php
index cb3c05d2bca..da49db32d19 100644
--- a/lib/private/files/view.php
+++ b/lib/private/files/view.php
@@ -642,10 +642,10 @@ class View {
}
$run = true;
- if ($this->shouldEmitHooks() && (Cache\Scanner::isPartialFile($path1) && !Cache\Scanner::isPartialFile($path2))) {
+ if ($this->shouldEmitHooks($path1) && (Cache\Scanner::isPartialFile($path1) && !Cache\Scanner::isPartialFile($path2))) {
// if it was a rename from a part file to a regular file it was a write and not a rename operation
$this->emit_file_hooks_pre($exists, $path2, $run);
- } elseif ($this->shouldEmitHooks()) {
+ } elseif ($this->shouldEmitHooks($path1)) {
\OC_Hook::emit(
Filesystem::CLASSNAME, Filesystem::signal_rename,
array(
@@ -1087,6 +1087,11 @@ class View {
return true;
}
$fullPath = $this->getAbsolutePath($path);
+
+ if ($fullPath === $defaultRoot) {
+ return true;
+ }
+
return (strlen($fullPath) > strlen($defaultRoot)) && (substr($fullPath, 0, strlen($defaultRoot) + 1) === $defaultRoot . '/');
}