Physikerwelt has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/230393

Change subject: Fix: Special page ShowMathImage should read the mode as string
......................................................................

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
---
M SpecialMathShowImage.php
1 file changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Math 
refs/changes/93/230393/1

diff --git a/SpecialMathShowImage.php b/SpecialMathShowImage.php
index 6b6c956..d3b5b33 100644
--- a/SpecialMathShowImage.php
+++ b/SpecialMathShowImage.php
@@ -49,7 +49,7 @@
                } 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 @@
                        $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 @@
        /**
         * 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;

-- 
To view, visit https://gerrit.wikimedia.org/r/230393
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia63fad2d08cca2d4b0ed6ce09b72a30d6cfc9cac
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Math
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to