check if fopen was successful before continue
This commit is contained in:
parent
c7883b1769
commit
dd6cb67030
|
@ -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
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue