From bafc1e5245bb13e3bbc26d45b6aa015442bb99a6 Mon Sep 17 00:00:00 2001 From: Louis Chemineau Date: Mon, 2 Dec 2024 12:56:02 +0100 Subject: [PATCH] fix: Throw exception when copy failed Signed-off-by: Louis Chemineau --- apps/dav/lib/Connector/Sabre/Directory.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/apps/dav/lib/Connector/Sabre/Directory.php b/apps/dav/lib/Connector/Sabre/Directory.php index a193417831cd4..ebef7f91ee06d 100644 --- a/apps/dav/lib/Connector/Sabre/Directory.php +++ b/apps/dav/lib/Connector/Sabre/Directory.php @@ -447,7 +447,13 @@ public function copyInto($targetName, $sourcePath, INode $sourceNode) { throw new InvalidPath($ex->getMessage()); } - return $this->fileView->copy($sourcePath, $destinationPath); + $copyOkay = $this->fileView->copy($sourcePath, $destinationPath); + + if (!$copyOkay) { + throw new \Sabre\DAV\Exception\Forbidden('Copy did not proceed'); + } + + return true; } catch (StorageNotAvailableException $e) { throw new ServiceUnavailable($e->getMessage(), $e->getCode(), $e); } catch (ForbiddenException $ex) {