* (bug 16440) Broken 0-byte math renderings are now deleted and re-rendered when...
authorBrion Vibber <brion@users.mediawiki.org>
Wed, 26 Nov 2008 02:13:40 +0000 (02:13 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Wed, 26 Nov 2008 02:13:40 +0000 (02:13 +0000)
RELEASE-NOTES
includes/Math.php

index 25b1c40..3addd8f 100644 (file)
@@ -366,6 +366,8 @@ The following extensions are migrated into MediaWiki 1.14:
 * (bug 7726) Searches for words less than 4 characters now work without
   requiring customization of MySQL server settings
 * Honour unchecked "Leave a redirect behind" for moved subpages
+* (bug 16440) Broken 0-byte math renderings are now deleted and re-rendered
+  when page is re-parsed.
 
 === API changes in 1.14 ===
 
index ca225d6..090400e 100644 (file)
@@ -209,8 +209,14 @@ class MathRenderer {
                        $this->html = $rpage->math_html;
                        $this->mathml = $rpage->math_mathml;
 
-                       if( file_exists( $this->_getHashPath() . "/{$this->hash}.png" ) ) {
-                               return true;
+                       $filename = $this->_getHashPath() . "/{$this->hash}.png";
+                       if( file_exists( $filename ) ) {
+                               if( filesize( $filename ) == 0 ) {
+                                       // Some horrible error corrupted stuff :(
+                                       @unlink( $filename );
+                               } else {
+                                       return true;
+                               }
                        }
 
                        if( file_exists( $wgMathDirectory . "/{$this->hash}.png" ) ) {