Physikerwelt has uploaded a new change for review.

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

Change subject: Prevent Special:MathShowImage from showing bad content
......................................................................

Prevent Special:MathShowImage from showing bad content

This commit prohibits that the special-page MathShowImages
tries to display information that are not enabled via
config.

A typical example is that the Specialpage tries to
render PNG images for IE<9 even though texvc was not
set up. This was reported as

Bug: 69693
Change-Id: Ifc5888152aa02c973eab959e963085f24a7b2a83
---
M SpecialMathShowImage.php
1 file changed, 9 insertions(+), 1 deletion(-)


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

diff --git a/SpecialMathShowImage.php b/SpecialMathShowImage.php
index d3fa70e..b223949 100644
--- a/SpecialMathShowImage.php
+++ b/SpecialMathShowImage.php
@@ -38,11 +38,19 @@
        }
 
        function execute( $par ) {
+        global $wgMathValidModes, $wgMathEnableExperimentalInputFormats;
                $request = $this->getRequest();
                $hash = $request->getText( 'hash', '' );
                $tex = $request->getText( 'tex', '');
-               $asciimath = $request->getText( 'asciimath', '');
+        if( $wgMathEnableExperimentalInputFormats ){
+            $asciimath = $request->getText( 'asciimath', '');
+        } else {
+            $asciimath = '';
+        }
                $this->mode = $request->getInt( 'mode', MW_MATH_MATHML );
+        if( ! in_array( $this->mode, $wgMathValidModes ) ){
+            $this->mode ( MW_MATH_MATHML );
+        }
                if ( $hash === '' && $tex === '' && $asciimath === '' ) {
                        $this->setHeaders( false );
                        echo $this->printSvgError( 'No Inputhash specified' );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifc5888152aa02c973eab959e963085f24a7b2a83
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Math
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt <w...@physikerwelt.de>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to