From: Brion Vibber Date: Wed, 26 Nov 2008 02:13:40 +0000 (+0000) Subject: * (bug 16440) Broken 0-byte math renderings are now deleted and re-rendered when... X-Git-Tag: 1.31.0-rc.0~44200 X-Git-Url: http://git.cyclocoop.org/%22.%24redirect_annul.%22?a=commitdiff_plain;h=02fd99793fd6e33f5ac35a5a45cac6e7ee2791c9;p=lhc%2Fweb%2Fwiklou.git * (bug 16440) Broken 0-byte math renderings are now deleted and re-rendered when page is re-parsed. --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 25b1c40f77..3addd8f649 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 === diff --git a/includes/Math.php b/includes/Math.php index ca225d6c22..090400e18b 100644 --- a/includes/Math.php +++ b/includes/Math.php @@ -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" ) ) {