diff --git a/lib/private/Files/View.php b/lib/private/Files/View.php index 4a9ef9f8138..47eb6f1fe6c 100644 --- a/lib/private/Files/View.php +++ b/lib/private/Files/View.php @@ -937,7 +937,7 @@ class View { try { $exists = $this->file_exists($target); - if ($this->shouldEmitHooks($target)) { + if ($this->shouldEmitHooks($source) && $this->shouldEmitHooks($target)) { \OC_Hook::emit( Filesystem::CLASSNAME, Filesystem::signal_copy, @@ -977,7 +977,7 @@ class View { $this->changeLock($target, ILockingProvider::LOCK_SHARED); $lockTypePath2 = ILockingProvider::LOCK_SHARED; - if ($this->shouldEmitHooks($target) && $result !== false) { + if ($this->shouldEmitHooks($source) && $this->shouldEmitHooks($target) && $result !== false) { \OC_Hook::emit( Filesystem::CLASSNAME, Filesystem::signal_post_copy,