From 4d623150532e97f0b3366ef5957437fcede3395b Mon Sep 17 00:00:00 2001 From: Happy-melon Date: Sun, 24 Apr 2011 11:11:10 +0000 Subject: [PATCH] MathCaptcha requires the texvc functions, which are now in the Math extension. --- MathCaptcha.class.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/MathCaptcha.class.php b/MathCaptcha.class.php index 9e3d89153..5dbbeeb99 100644 --- a/MathCaptcha.class.php +++ b/MathCaptcha.class.php @@ -39,7 +39,11 @@ class MathCaptcha extends SimpleCaptcha { /** Fetch the math */ function fetchMath( $sum ) { - $math = new MathRenderer( $sum ); + if( MWInit::classExists( 'MathRenderer' ) ){ + $math = new MathRenderer( $sum ); + } else { + throw new MWException( 'MathCaptcha requires the Math extension for MediaWiki versions 1.18 and above.' ); + } $math->setOutputMode( MW_MATH_PNG ); $html = $math->render(); return preg_replace( '/alt=".*?"/', '', $html );