Do not try to close the same resource multiple times
This commit is contained in:
parent
adca48aa93
commit
989da69cff
|
@ -670,7 +670,12 @@ class View {
|
||||||
$source = fopen($tmpFile, 'r');
|
$source = fopen($tmpFile, 'r');
|
||||||
if ($source) {
|
if ($source) {
|
||||||
$this->file_put_contents($path, $source);
|
$this->file_put_contents($path, $source);
|
||||||
|
// $this->file_put_contents() might have already closed
|
||||||
|
// the resource, so we check it, before trying to close it
|
||||||
|
// to avoid messages in the error log.
|
||||||
|
if (is_resource($source)) {
|
||||||
fclose($source);
|
fclose($source);
|
||||||
|
}
|
||||||
unlink($tmpFile);
|
unlink($tmpFile);
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue