Merge "Avoid calling readFromDatabase in source mode"

This commit is contained in:
Frédéric Wang 2014-10-11 15:47:01 +00:00 committed by Gerrit Code Review
commit 80361d2911
2 changed files with 10 additions and 1 deletions

View File

@ -610,7 +610,7 @@ abstract class MathRenderer {
// equation was already checked or checking is disabled
return true;
} else {
if( (int) $wgMathDisableTexFilter == MW_MATH_CHECK_NEW ){
if( (int) $wgMathDisableTexFilter == MW_MATH_CHECK_NEW && $this->mode != MW_MATH_SOURCE ){
if( $this->readFromDatabase() ){
return true;
}

View File

@ -19,6 +19,15 @@
* @ingroup Parser
*/
class MathSource extends MathRenderer {
/**
* @param string $tex
* @param array $params
*/
function __construct( $tex = '', $params = array() ) {
parent::__construct( $tex, $params );
$this->setMode( MW_MATH_SOURCE );
}
/**
* Renders TeX by outputting it to the browser in a span tag
*