diff --git a/MathRenderer.php b/MathRenderer.php index 2f0b16cdf..925321fbd 100644 --- a/MathRenderer.php +++ b/MathRenderer.php @@ -137,7 +137,7 @@ abstract class MathRenderer { public function getInputHash() { // TODO: What happens if $tex is empty? $dbr = wfGetDB( DB_SLAVE ); - return $dbr->encodeBlob( pack( "H32", md5( $this->tex ) ) ); # Binary packed, not hex + return $dbr->encodeBlob( pack( "H32", md5( $this->getUserInputTex() ) ) ); # Binary packed, not hex } /** @@ -443,5 +443,12 @@ abstract class MathRenderer { } } } + + /** + * @return string original tex string specified by the user + */ + public function getUserInputTex(){ + return $this->userInputTex; + } } diff --git a/MathTexvc.php b/MathTexvc.php index 1c69d47ca..89eb94ddc 100644 --- a/MathTexvc.php +++ b/MathTexvc.php @@ -110,7 +110,7 @@ class MathTexvc extends MathRenderer { * @return int|string MW_TEXVC_SUCCESS or error string */ public function callTexvc() { - global $wgTexvc, $wgTexvcBackgroundColor, $wgUseSquid, $wgMathCheckFiles, $wgHooks; + global $wgTexvc, $wgTexvcBackgroundColor, $wgHooks; wfProfileIn( __METHOD__ ); $tmpDir = wfTempDir(); @@ -125,7 +125,7 @@ class MathTexvc extends MathRenderer { $cmd = $wgTexvc . ' ' . $escapedTmpDir . ' ' . $escapedTmpDir . ' ' . - wfEscapeShellArg( $this->getTex() ) . ' ' . + wfEscapeShellArg( $this->getUserInputTex() ) . ' ' . wfEscapeShellArg( 'UTF-8' ) . ' ' . wfEscapeShellArg( $wgTexvcBackgroundColor );