diff --git a/Math.body.php b/Math.body.php index 54550bb..f4d2481 100644 --- a/Math.body.php +++ b/Math.body.php @@ -30,7 +30,7 @@ if ( !function_exists('wfEscapeSingleQuotes') ) { * @ingroup Parser */ class MathRenderer { - var $mode = MW_MATH_MODERN; + var $mode = MW_MATH_PNG; var $tex = ''; var $inputhash = ''; var $hash = ''; @@ -44,7 +44,13 @@ class MathRenderer { } function setOutputMode( $mode ) { - $this->mode = $mode; + $validModes = array( MW_MATH_PNG, MW_MATH_SOURCE ); + if ( in_array( $mode, $validModes ) ) { + $this->mode = $mode; + } else { + // Several mixed modes have been phased out. + $this->mode = MW_MATH_PNG; + } } function render() { diff --git a/Math.hooks.php b/Math.hooks.php index 4875838..25a7b39 100644 --- a/Math.hooks.php +++ b/Math.hooks.php @@ -74,11 +74,7 @@ class MathHooks { private static function getMathNames() { return array( MW_MATH_PNG => 'mw_math_png', - MW_MATH_SIMPLE => 'mw_math_simple', - MW_MATH_HTML => 'mw_math_html', - MW_MATH_SOURCE => 'mw_math_source', - MW_MATH_MODERN => 'mw_math_modern', - MW_MATH_MATHML => 'mw_math_mathml' + MW_MATH_SOURCE => 'mw_math_source' ); } diff --git a/Math.php b/Math.php index a2477b7..bfc4e68 100644 --- a/Math.php +++ b/Math.php @@ -31,11 +31,11 @@ $wgExtensionCredits['parserhook'][] = array( * Maths constants */ define( 'MW_MATH_PNG', 0 ); -define( 'MW_MATH_SIMPLE', 1 ); -define( 'MW_MATH_HTML', 2 ); +define( 'MW_MATH_SIMPLE', 1 ); /// @deprecated +define( 'MW_MATH_HTML', 2 ); /// @deprecated define( 'MW_MATH_SOURCE', 3 ); -define( 'MW_MATH_MODERN', 4 ); -define( 'MW_MATH_MATHML', 5 ); +define( 'MW_MATH_MODERN', 4 ); /// @deprecated +define( 'MW_MATH_MATHML', 5 ); /// @deprecated /**@}*/ /** For back-compat */ @@ -84,6 +84,7 @@ $wgMathDirectory = false; ////////// end of config settings. +$wgDefaultUserOptions['math'] = MW_MATH_PNG; $wgExtensionFunctions[] = 'MathHooks::setup'; $wgHooks['ParserFirstCallInit'][] = 'MathHooks::onParserFirstCallInit';