Try to avoid file caching php fatals, it's very annoying
authorAaron Schulz <aaron@users.mediawiki.org>
Tue, 17 Feb 2009 15:05:23 +0000 (15:05 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Tue, 17 Feb 2009 15:05:23 +0000 (15:05 +0000)
includes/HTMLFileCache.php

index e267962..ce4c11a 100644 (file)
@@ -165,7 +165,10 @@ class HTMLFileCache {
                        return $origtext; // return to output
                }
                $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);