From 72e90545454c0e014318fa3c81658e035aac58c1 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Wed, 10 Jun 2009 13:00:47 +0200 Subject: applying patch to version 1.15.0 --- includes/HTMLFileCache.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'includes/HTMLFileCache.php') diff --git a/includes/HTMLFileCache.php b/includes/HTMLFileCache.php index e267962c..68cafa24 100644 --- a/includes/HTMLFileCache.php +++ b/includes/HTMLFileCache.php @@ -128,7 +128,6 @@ class HTMLFileCache { public function loadFromFileCache() { global $wgOut, $wgMimeType, $wgOutputEncoding, $wgContLanguageCode; wfDebug(" loadFromFileCache()\n"); - $filename = $this->fileCacheName(); // Raw pages should handle cache control on their own, // even when using file cache. This reduces hits from clients. @@ -148,6 +147,7 @@ class HTMLFileCache { } } readfile( $filename ); + $wgOut->disable(); // tell $wgOut that output is taken care of } protected function checkCacheDirs() { @@ -159,13 +159,12 @@ class HTMLFileCache { wfMkdirParents( $mydir2 ); } - public function saveToFileCache( $origtext ) { + public function saveToFileCache( $text ) { global $wgUseFileCache; - if( !$wgUseFileCache ) { - return $origtext; // return to output + if( !$wgUseFileCache || strlen( $text ) < 512 ) { + // Disabled or empty/broken output (OOM and PHP errors) + return $text; } - $text = $origtext; - if( strcmp($text,'') == 0 ) return ''; wfDebug(" saveToFileCache()\n", false); -- cgit v1.2.3-54-g00ecf