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
This commit is contained in:
physikerwelt 2015-08-09 07:45:57 -03:00
parent 90e0f3f6b6
commit df19011704

View file

@ -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;