<?php
/**
* Contain everything related to <math> </math> parsing
- * @package MediaWiki
*/
/**
*
* by Tomasz Wegrzanowski, with additions by Brion Vibber (2003, 2004)
*
- * @package MediaWiki
*/
class MathRenderer {
var $mode = MW_MATH_MODERN;
var $mathml = '';
var $conservativeness = 0;
- function MathRenderer( $tex ) {
+ function __construct( $tex ) {
$this->tex = $tex;
}
# 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...
$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,
$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