summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Gapczynski <mtgap@owncloud.com>2013-04-13 15:02:47 -0400
committerMichael Gapczynski <mtgap@owncloud.com>2013-04-13 15:02:47 -0400
commit4f6f6456aad8777ac722fb7bb061d2978d702647 (patch)
tree4636e95f2525595cb5a544741b70ad661fe388a4
parentf480596b9492c43b69f35ce4dedd53762a263d4b (diff)
downloadnextcloud-server-4f6f6456aad8777ac722fb7bb061d2978d702647.tar.gz
nextcloud-server-4f6f6456aad8777ac722fb7bb061d2978d702647.zip
Check if operation worked before sending post hooks, fixes #2484
-rw-r--r--lib/files/view.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/files/view.php b/lib/files/view.php
index f607bb59aac..b0e82919359 100644
--- a/lib/files/view.php
+++ b/lib/files/view.php
@@ -295,7 +295,7 @@ class View {
list ($count, $result) = \OC_Helper::streamCopy($data, $target);
fclose($target);
fclose($data);
- if ($this->fakeRoot == Filesystem::getRoot() && ! Cache\Scanner::isIgnoredFile($path) ) {
+ if ($this->fakeRoot == Filesystem::getRoot() && ! Cache\Scanner::isIgnoredFile($path) && $result !== false) {
if (!$exists) {
\OC_Hook::emit(
Filesystem::CLASSNAME,
@@ -372,7 +372,7 @@ class View {
list($storage1, $internalPath1) = Filesystem::resolvePath($absolutePath1 . $postFix1);
$storage1->unlink($internalPath1);
}
- if ($this->fakeRoot == Filesystem::getRoot()) {
+ if ($this->fakeRoot == Filesystem::getRoot() && $result !== false) {
\OC_Hook::emit(
Filesystem::CLASSNAME,
Filesystem::signal_post_rename,
@@ -452,7 +452,7 @@ class View {
$target = $this->fopen($path2 . $postFix2, 'w');
list($count, $result) = \OC_Helper::streamCopy($source, $target);
}
- if ($this->fakeRoot == Filesystem::getRoot()) {
+ if ($this->fakeRoot == Filesystem::getRoot() && $result !== false) {
\OC_Hook::emit(
Filesystem::CLASSNAME,
Filesystem::signal_post_copy,
@@ -613,7 +613,7 @@ class View {
$result = $storage->$operation($internalPath);
}
$result = \OC_FileProxy::runPostProxies($operation, $this->getAbsolutePath($path), $result);
- if (Filesystem::$loaded and $this->fakeRoot == Filesystem::getRoot()) {
+ if (Filesystem::$loaded and $this->fakeRoot == Filesystem::getRoot() && $result !== false) {
if ($operation != 'fopen') { //no post hooks for fopen, the file stream is still open
$this->runHooks($hooks, $path, true);
}