From 59cf608afb70825e7c6fb4b0d93bee7c9f0b5863 Mon Sep 17 00:00:00 2001 From: Salvatore Martire <4652631+salmart-dev@users.noreply.github.com> Date: Mon, 2 Mar 2026 13:15:11 +0100 Subject: [PATCH] fix: check source and target when emitting copy event Signed-off-by: Salvatore Martire <4652631+salmart-dev@users.noreply.github.com> --- lib/private/Files/View.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/private/Files/View.php b/lib/private/Files/View.php index af71e419841c1..1ce93560d2c52 100644 --- a/lib/private/Files/View.php +++ b/lib/private/Files/View.php @@ -937,7 +937,7 @@ public function copy($source, $target, $preserveMtime = false) { 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 @@ public function copy($source, $target, $preserveMtime = false) { $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,