jenkins-bot has submitted this change and it was merged.

Change subject: Math: tidy up error message handling
......................................................................


Math: tidy up error message handling

- We don't localize errors and debug logs like this, it makes them
  impossible to decipher
- Also remove some 1.21 and below back-compat while we're here

Change-Id: Idb23fe5b434fa9fa3518672d57ec6e5466d005ac
---
M MathInputCheckTexvc.php
M MathMathML.php
M MathRenderer.php
M i18n/en.json
4 files changed, 3 insertions(+), 16 deletions(-)

Approvals:
  Krinkle: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/MathInputCheckTexvc.php b/MathInputCheckTexvc.php
index 9023fc7..b2eb6a6 100644
--- a/MathInputCheckTexvc.php
+++ b/MathInputCheckTexvc.php
@@ -60,7 +60,7 @@
        public function doValidCheck() {
                global $wgMathTexvcCheckExecutable;
                if ( !is_executable( $wgMathTexvcCheckExecutable ) ) {
-                       $msg = wfMessage( 'math_notexvccheck' 
)->inContentLanguage()->escaped();
+                       $msg = 'Missing "texvccheck" executable. Please see 
math/README to configure.';
                        trigger_error( $msg, E_USER_NOTICE );
                        wfDebugLog( 'Math', $msg );
                        return true;
diff --git a/MathMathML.php b/MathMathML.php
index c40f8b9..824498d 100644
--- a/MathMathML.php
+++ b/MathMathML.php
@@ -292,13 +292,7 @@
                if ( !$this->XMLValidation ) {
                        return true;
                }
-               // depends on https://gerrit.wikimedia.org/r/#/c/66365/
-               if ( !is_callable( 'XmlTypeCheck::newFromString' ) ) {
-                       $msg = wfMessage( 'math_xmlversion' 
)->inContentLanguage()->escaped();
-                       trigger_error( $msg, E_USER_NOTICE );
-                       wfDebugLog( 'Math', $msg );
-                       return true;
-               }
+
                $xmlObject = new XmlTypeCheck( $XML, null, false );
                if ( !$xmlObject->wellFormed ) {
                        wfDebugLog( 'Math', "XML validation error:\n " . 
var_export( $XML, true ) . "\n" );
diff --git a/MathRenderer.php b/MathRenderer.php
index b1b2bc6..c50bb3c 100644
--- a/MathRenderer.php
+++ b/MathRenderer.php
@@ -457,12 +457,7 @@
         * @return string in UTF-8 encoding
         */
        public function getMathml() {
-               if ( ! is_callable( 'StringUtils::isUtf8' ) ) {
-                       $msg = wfMessage( 'math_latexml_xmlversion' 
)->inContentLanguage()->escaped();
-                       trigger_error( $msg, E_USER_NOTICE );
-                       wfDebugLog( 'Math', $msg );
-                       // If we can not check if mathml output is valid, we 
skip the test and assume that it is valid.
-               } elseif ( ! StringUtils::isUtf8( $this->mathml ) ) {
+               if ( !StringUtils::isUtf8( $this->mathml ) ) {
                        $this->setMathml( '' );
                }
                return $this->mathml;
diff --git a/i18n/en.json b/i18n/en.json
index 75ec763..8072ce1 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -23,7 +23,6 @@
     "math_lexing_error": "lexing error",
     "math_mathoid_error": "Conversion error. Server (\"$1\") reported: \"$2\"",
     "math_notexvc": "Missing <code>texvc</code> executable. Please see 
math/README to configure.",
-    "math_notexvccheck": "Missing <code>texvccheck</code> executable. Please 
see math/README to configure.",
     "math_output_error": "Cannot store math image on filesystem.",
     "math_sample": "Insert formula here",
     "math_syntax_error": "syntax error",
@@ -31,7 +30,6 @@
     "math_tip": "Mathematical formula (LaTeX)",
     "math_unknown_error": "unknown error",
     "math_unknown_function": "unknown function \"$1\"",
-    "math_xmlversion": "Warning: XML type check skipped! Check if your 
MediaWiki installation is version wmf/1.22wmf7 or newer.",
     "mw_math_latexml": "LaTeXML (experimental; uses MathML)",
     "mw_math_latexml_jax": "LaTeXML with client-side MathJax (experimental; 
uses MathML)",
     "mw_math_mathjax": "Client-side MathJax (slow; improves rendering on some 
browsers and accessibility tools)",

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Idb23fe5b434fa9fa3518672d57ec6e5466d005ac
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Math
Gerrit-Branch: master
Gerrit-Owner: Chad <[email protected]>
Gerrit-Reviewer: Krinkle <[email protected]>
Gerrit-Reviewer: Siebrand <[email protected]>
Gerrit-Reviewer: TheDJ <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to