From 72bdb51be1adf248e04ac8ddcffbbef53e026faa Mon Sep 17 00:00:00 2001 From: Marko Obrovac Date: Mon, 14 Dec 2015 23:28:40 +0100 Subject: [PATCH] Ask for the MathML and SVG renders only if the input is valid Bug: T121445 Change-Id: I18b1ef4906f98cea99dca21d5a986a79c02cc233 --- MathMathML.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/MathMathML.php b/MathMathML.php index dff9f41..f407b45 100644 --- a/MathMathML.php +++ b/MathMathML.php @@ -96,10 +96,11 @@ class MathMathML extends MathRenderer { $displaystyle = true; } $rbi = new MathRestbaseInterface( $tex, $displaystyle ); - $rbi->checkTeX(); - $this->mathml = $rbi->getMathML(); - $this->svg = $rbi->getSvg(); - $this->svgPath = $rbi->getFullSvgUrl(); + if ( $rbi->checkTeX() ) { + $this->mathml = $rbi->getMathML(); + $this->svg = $rbi->getSvg(); + $this->svgPath = $rbi->getFullSvgUrl(); + } $this->changed = false; return $rbi->getSuccess(); }