Avoid calling readFromDatabase in source mode

In source mode there is no database cache,
so we do not need to call readFromDatabase there.

Change-Id: I791eab923f5ed6e0a3e28dbaf49ba1ae8fdb6cdc
This commit is contained in:
physikerwelt (Moritz Schubotz) 2014-10-11 16:04:18 +02:00
parent 0ddd3afaea
commit 3564b7cfe8
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
*