Make sure BlockHideName really defaults to 0, not false. Fixes bug 10007.
[lhc/web/wiklou.git] / includes / Math.php
index 30b4bfe..88934e5 100644 (file)
@@ -1,7 +1,6 @@
 <?php
 /**
  * Contain everything related to <math> </math> parsing
- * @package MediaWiki
  */
 
 /**
@@ -11,7 +10,6 @@
  *
  * by Tomasz Wegrzanowski, with additions by Brion Vibber (2003, 2004)
  *
- * @package MediaWiki
  */
 class MathRenderer {
        var $mode = MW_MATH_MODERN;
@@ -22,7 +20,7 @@ class MathRenderer {
        var $mathml = '';
        var $conservativeness = 0;
 
-       function MathRenderer( $tex ) {
+       function __construct( $tex ) {
                $this->tex = $tex;
        }
 
@@ -39,6 +37,9 @@ class MathRenderer {
                        # No need to render or parse anything more!
                        return ('$ '.htmlspecialchars( $this->tex ).' $');
                }
+               if( $this->tex == '' ) {
+                       return; # bug 8372
+               }
 
                if( !$this->_recall() ) {
                        # Ensure that the temp and output directories are available before continuing...
@@ -153,7 +154,7 @@ class MathRenderer {
 
                                $md5_sql = pack('H32', $this->md5); # Binary packed, not hex
 
-                               $dbw =& wfGetDB( DB_MASTER );
+                               $dbw = wfGetDB( DB_MASTER );
                                $dbw->replace( 'math', array( 'math_inputhash' ),
                                  array(
                                        'math_inputhash' => $md5_sql,
@@ -182,7 +183,7 @@ class MathRenderer {
                $fname = 'MathRenderer::_recall';
 
                $this->md5 = md5( $this->tex );
-               $dbr =& wfGetDB( DB_SLAVE );
+               $dbr = wfGetDB( DB_SLAVE );
                $rpage = $dbr->selectRow( 'math',
                        array( 'math_outputhash','math_html_conservativeness','math_html','math_mathml' ),
                        array( 'math_inputhash' => pack("H32", $this->md5)), # Binary packed, not hex