diff options
author | Louis Chemineau <louis@chmn.me> | 2024-12-02 12:56:02 +0100 |
---|---|---|
committer | Louis Chemineau <louis@chmn.me> | 2024-12-04 16:23:39 +0100 |
commit | 8be6a7c7dd51b018a20fb4f1c7e530999bc10faf (patch) | |
tree | 087fb7213a59d42c94bbe59644e57b0ca12f2c7f /apps | |
parent | 8be7b9ea40e7e925d2d2f0adf2e3d6b166f0a1fa (diff) | |
download | nextcloud-server-8be6a7c7dd51b018a20fb4f1c7e530999bc10faf.tar.gz nextcloud-server-8be6a7c7dd51b018a20fb4f1c7e530999bc10faf.zip |
fix: Throw exception when copy failed
Signed-off-by: Louis Chemineau <louis@chmn.me>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/dav/lib/Connector/Sabre/Directory.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/apps/dav/lib/Connector/Sabre/Directory.php b/apps/dav/lib/Connector/Sabre/Directory.php index a193417831c..ebef7f91ee0 100644 --- a/apps/dav/lib/Connector/Sabre/Directory.php +++ b/apps/dav/lib/Connector/Sabre/Directory.php @@ -447,7 +447,13 @@ class Directory extends Node implements \Sabre\DAV\ICollection, \Sabre\DAV\IQuot 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) { |