From 4c881d994731f61908bc4b5b4db119bb2ce40384 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Tue, 17 Feb 2009 19:08:24 +0000 Subject: [PATCH] Follow-up to r47361: code style cleanup (consolidate a couple of duplicated checks, unneeded variable copying) --- includes/HTMLFileCache.php | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/includes/HTMLFileCache.php b/includes/HTMLFileCache.php index ce4c11a57a..5745de4334 100644 --- a/includes/HTMLFileCache.php +++ b/includes/HTMLFileCache.php @@ -159,16 +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; - // Empty? - if( strcmp($text,'') == 0 ) return ''; - // Probably broken? (OOM and PHP errors) - if( mb_strlen($text) < 512 ) return $origtext; wfDebug(" saveToFileCache()\n", false); -- 2.20.1