diff options
author | Bjoern Schiessle <schiessle@owncloud.com> | 2015-10-15 12:12:52 +0200 |
---|---|---|
committer | Bjoern Schiessle <schiessle@owncloud.com> | 2015-10-15 16:27:38 +0200 |
commit | dd6cb67030a260c94ec00770c966bc66dc24a308 (patch) | |
tree | 21c0b42707f7366e62d7e6e37b6f1eef271454fb /lib/private | |
parent | c7883b1769eb785264abcbf84a363100ff784228 (diff) | |
download | nextcloud-server-dd6cb67030a260c94ec00770c966bc66dc24a308.tar.gz nextcloud-server-dd6cb67030a260c94ec00770c966bc66dc24a308.zip |
check if fopen was successful before continue
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/files/storage/wrapper/encryption.php | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/private/files/storage/wrapper/encryption.php b/lib/private/files/storage/wrapper/encryption.php index aade7cd8bb1..2f0c1e35b04 100644 --- a/lib/private/files/storage/wrapper/encryption.php +++ b/lib/private/files/storage/wrapper/encryption.php @@ -195,9 +195,13 @@ class Encryption extends Wrapper { public function file_put_contents($path, $data) { // file put content will always be translated to a stream write $handle = $this->fopen($path, 'w'); - $written = fwrite($handle, $data); - fclose($handle); - return $written; + if (is_resource($handle)) { + $written = fwrite($handle, $data); + fclose($handle); + return $written; + } + + return false; } /** |