Do not try to close the same resource multiple times
This commit is contained in:
parent
adca48aa93
commit
989da69cff
1 changed files with 6 additions and 1 deletions
|
@ -670,7 +670,12 @@ class View {
|
|||
$source = fopen($tmpFile, 'r');
|
||||
if ($source) {
|
||||
$this->file_put_contents($path, $source);
|
||||
fclose($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);
|
||||
}
|
||||
unlink($tmpFile);
|
||||
return true;
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue