diff options
author | Louis Chemineau <louis@chmn.me> | 2024-12-02 12:56:02 +0100 |
---|---|---|
committer | Louis Chemineau <louis@chmn.me> | 2024-12-05 10:48:30 +0100 |
commit | 3497725235857a52fab32634aef6bf725a57dcb9 (patch) | |
tree | 69c605da9748b5b6f34fbb28b1aab47a114579ac /apps | |
parent | 3b6920fa81b56965752e7c4780f730049b6d9489 (diff) | |
download | nextcloud-server-3497725235857a52fab32634aef6bf725a57dcb9.tar.gz nextcloud-server-3497725235857a52fab32634aef6bf725a57dcb9.zip |
fix: Throw exception when copy failedbackport/49293/stable30
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 d56f56890cc..8f637455403 100644 --- a/apps/dav/lib/Connector/Sabre/Directory.php +++ b/apps/dav/lib/Connector/Sabre/Directory.php @@ -445,7 +445,13 @@ class Directory extends \OCA\DAV\Connector\Sabre\Node implements \Sabre\DAV\ICol 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) { |