From df19011704bea95605997dad67079a8268ff4a70 Mon Sep 17 00:00:00 2001 From: physikerwelt Date: Sun, 9 Aug 2015 07:45:57 -0300 Subject: [PATCH] Fix: Special page ShowMathImage should read the mode as string The special page used getInt to read the mode parameter that was changed to be a string and no longer an integer. Bug: T108388 Change-Id: Ia63fad2d08cca2d4b0ed6ce09b72a30d6cfc9cac --- SpecialMathShowImage.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/SpecialMathShowImage.php b/SpecialMathShowImage.php index 6b6c956..8ded73d 100644 --- a/SpecialMathShowImage.php +++ b/SpecialMathShowImage.php @@ -49,7 +49,7 @@ class SpecialMathShowImage extends SpecialPage { } else { $asciimath = ''; } - $this->mode = $request->getInt( 'mode', 'mathml' ); + $this->mode = MathHooks::mathModeToString( $request->getText( 'mode' ), 'mathml' ); if ( !in_array( $this->mode, MathRenderer::getValidModes() ) ) { // Fallback to the default if an invalid mode was specified $this->mode = 'mathml'; @@ -58,7 +58,7 @@ class SpecialMathShowImage extends SpecialPage { $this->setHeaders( false ); echo $this->printSvgError( 'No Inputhash specified' ); } else { - if ( $tex === '' && $asciimath === ''){ + if ( $tex === '' && $asciimath === '' ){ switch ( $this->mode ) { case 'png': $this->renderer = MathTexvc::newFromMd5( $hash ); @@ -116,7 +116,7 @@ class SpecialMathShowImage extends SpecialPage { /** * Prints the specified error message as svg. * @param string $msg error message - * @return xml svg image with the error message + * @return string xml svg image with the error message */ private function printSvgError( $msg ) { global $wgDebugComments;