From 989da69cffbdd7f3a7e7f6635b465428d7ffe14f Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 25 Aug 2014 15:31:43 +0200 Subject: [PATCH] Do not try to close the same resource multiple times --- lib/private/files/view.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 { -- 2.39.5