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
This commit is contained in:
Chad Horohoe 2015-02-19 16:22:46 -08:00
parent 504a53f8e1
commit eab415ef71
4 changed files with 3 additions and 16 deletions

View File

@ -60,7 +60,7 @@ class MathInputCheckTexvc extends MathInputCheck {
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;

View File

@ -292,13 +292,7 @@ class MathMathML extends MathRenderer {
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" );

View File

@ -457,12 +457,7 @@ abstract class MathRenderer {
* @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;

View File

@ -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)",