Index: trunk/extensions/ConfirmEdit/MathCaptcha.class.php |
— | — | @@ -39,7 +39,11 @@ |
40 | 40 | |
41 | 41 | /** Fetch the math */ |
42 | 42 | function fetchMath( $sum ) { |
43 | | - $math = new MathRenderer( $sum ); |
| 43 | + if( MWInit::classExists( 'MathRenderer' ) ){ |
| 44 | + $math = new MathRenderer( $sum ); |
| 45 | + } else { |
| 46 | + throw new MWException( 'MathCaptcha requires the Math extension for MediaWiki versions 1.18 and above.' ); |
| 47 | + } |
44 | 48 | $math->setOutputMode( MW_MATH_PNG ); |
45 | 49 | $html = $math->render(); |
46 | 50 | return preg_replace( '/alt=".*?"/', '', $html ); |