Follow-up to r47361: code style cleanup (consolidate a couple of duplicated checks...
authorBrion Vibber <brion@users.mediawiki.org>
Tue, 17 Feb 2009 19:08:24 +0000 (19:08 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Tue, 17 Feb 2009 19:08:24 +0000 (19:08 +0000)
includes/HTMLFileCache.php

index ce4c11a..5745de4 100644 (file)
@@ -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);