summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2014-08-25 15:31:43 +0200
committerJoas Schilling <nickvergessen@gmx.de>2014-08-25 15:31:43 +0200
commit989da69cffbdd7f3a7e7f6635b465428d7ffe14f (patch)
tree0b031fa325a1b7b50c5ecba08da00e3dacb1763b
parentadca48aa93c6137d85d7ed0888dcdec2273faa48 (diff)
downloadnextcloud-server-989da69cffbdd7f3a7e7f6635b465428d7ffe14f.tar.gz
nextcloud-server-989da69cffbdd7f3a7e7f6635b465428d7ffe14f.zip
Do not try to close the same resource multiple times
-rw-r--r--lib/private/files/view.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/private/files/view.php b/lib/private/files/view.php
index 1037056b0fb..d310a0fa4e1 100644
--- a/lib/private/files/view.php
+++ b/lib/private/files/view.php
@@ -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 {