Skip to content

Commit 0e6c8ec

Browse files
Merge pull request #58660 from nextcloud/fix/chunked-uploads-on-shared-folders
fix: check source and target when emitting copy event
2 parents 52e8de9 + 8431abf commit 0e6c8ec

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/private/Files/View.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -950,7 +950,7 @@ public function copy($source, $target, $preserveMtime = false) {
950950

951951
try {
952952
$exists = $this->file_exists($target);
953-
if ($this->shouldEmitHooks($target)) {
953+
if ($this->shouldEmitHooks($source) && $this->shouldEmitHooks($target)) {
954954
\OC_Hook::emit(
955955
Filesystem::CLASSNAME,
956956
Filesystem::signal_copy,
@@ -990,7 +990,7 @@ public function copy($source, $target, $preserveMtime = false) {
990990
$this->changeLock($target, ILockingProvider::LOCK_SHARED);
991991
$lockTypePath2 = ILockingProvider::LOCK_SHARED;
992992

993-
if ($this->shouldEmitHooks($target) && $result !== false) {
993+
if ($this->shouldEmitHooks($source) && $this->shouldEmitHooks($target) && $result !== false) {
994994
\OC_Hook::emit(
995995
Filesystem::CLASSNAME,
996996
Filesystem::signal_post_copy,

0 commit comments

Comments
 (0)