Merge pull request #10623 from owncloud/not-a-valid-resource-log-entries

Do not try to close the same resource multiple times
This commit is contained in:
Clark Tomlinson 2014-08-25 12:52:06 -04:00
commit 6523c575f3
1 changed files with 6 additions and 1 deletions

View File

@ -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 {