check if fopen was successful before continue

This commit is contained in:
Bjoern Schiessle 2015-10-15 12:12:52 +02:00
parent c7883b1769
commit dd6cb67030
1 changed files with 7 additions and 3 deletions

View File

@ -195,11 +195,15 @@ 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');
if (is_resource($handle)) {
$written = fwrite($handle, $data);
fclose($handle);
return $written;
}
return false;
}
/**
* see http://php.net/manual/en/function.unlink.php
*