From 63ca4c2104e7c61b6f2238b13bd5428b579be9e7 Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Sun, 1 May 2011 03:25:22 -0400 Subject: [PATCH] [feature/template-engine] Close output stream in compile(). There is no need to leave the stream to the garbage collector, and the amount of data stuck in it may be substantial. PHPBB3-9726 --- phpBB/includes/template_compile.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/phpBB/includes/template_compile.php b/phpBB/includes/template_compile.php index 3f8a028e25..e2bb9fd869 100644 --- a/phpBB/includes/template_compile.php +++ b/phpBB/includes/template_compile.php @@ -920,6 +920,9 @@ class phpbb_template_compile @fclose($source_handle); rewind($destination_handle); - return stream_get_contents($destination_handle); + $contents = stream_get_contents($destination_handle); + @fclose($dest_handle); + + return $contents; } }