diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2018-03-28 08:25:04 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-28 08:25:04 +0200 |
commit | 2124ebae72409d6d9da7221a558cddacb3145d74 (patch) | |
tree | 7da867ab54e6626a4eef575a3fc514373af61255 /lib/private | |
parent | b2e34167eb3fa3e6fdfa4ec13353a901e0725ebd (diff) | |
parent | f5b378fa84c351e0fbeda2ac5a695328972f9ecc (diff) | |
download | nextcloud-server-2124ebae72409d6d9da7221a558cddacb3145d74.tar.gz nextcloud-server-2124ebae72409d6d9da7221a558cddacb3145d74.zip |
Merge pull request #8737 from nextcloud/file_return_put_contents
Pass on the return value of file_put_content
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/Files/Node/File.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/private/Files/Node/File.php b/lib/private/Files/Node/File.php index 4bfa5d583f7..2ddbac97dce 100644 --- a/lib/private/Files/Node/File.php +++ b/lib/private/Files/Node/File.php @@ -26,6 +26,7 @@ namespace OC\Files\Node; +use OCP\Files\GenericFileException; use OCP\Files\NotPermittedException; class File extends Node implements \OCP\Files\File { @@ -57,11 +58,14 @@ class File extends Node implements \OCP\Files\File { /** * @param string $data * @throws \OCP\Files\NotPermittedException + * @throws \OCP\Files\GenericFileException */ public function putContent($data) { if ($this->checkPermissions(\OCP\Constants::PERMISSION_UPDATE)) { $this->sendHooks(array('preWrite')); - $this->view->file_put_contents($this->path, $data); + if ($this->view->file_put_contents($this->path, $data) === false) { + throw new GenericFileException('file_put_contents failed'); + } $this->fileInfo = null; $this->sendHooks(array('postWrite')); } else { |