From: Brion Vibber Date: Tue, 17 Feb 2009 19:08:24 +0000 (+0000) Subject: Follow-up to r47361: code style cleanup (consolidate a couple of duplicated checks... X-Git-Tag: 1.31.0-rc.0~42846 X-Git-Url: http://git.cyclocoop.org/wiki/Target_page?a=commitdiff_plain;h=4c881d994731f61908bc4b5b4db119bb2ce40384;p=lhc%2Fweb%2Fwiklou.git Follow-up to r47361: code style cleanup (consolidate a couple of duplicated checks, unneeded variable copying) --- 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);