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