MathCaptcha requires the texvc functions, which are now in the Math extension.
authorHappy-melon <happy-melon@users.mediawiki.org>
Sun, 24 Apr 2011 11:11:10 +0000 (11:11 +0000)
committerHappy-melon <happy-melon@users.mediawiki.org>
Sun, 24 Apr 2011 11:11:10 +0000 (11:11 +0000)
MathCaptcha.class.php

index 9e3d891532753d1112a9b313b5e45456de06ccfc..5dbbeeb99bc9a66a71c63d9e8571f6853d5a4ced 100644 (file)
@@ -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 );