r86811 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r86810‎ | r86811 | r86812 >
Date:11:11, 24 April 2011
Author:happy-melon
Status:ok
Tags:
Comment:
MathCaptcha requires the texvc functions, which are now in the Math extension.
Modified paths:
  • /trunk/extensions/ConfirmEdit/MathCaptcha.class.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ConfirmEdit/MathCaptcha.class.php
@@ -39,7 +39,11 @@
4040
4141 /** Fetch the math */
4242 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+ }
4448 $math->setOutputMode( MW_MATH_PNG );
4549 $html = $math->render();
4650 return preg_replace( '/alt=".*?"/', '', $html );

Follow-up revisions

RevisionCommit summaryAuthorDate
r92013Follow-up to r86811: changed MWInit::classExists() to class_exists() - the fo...yaron21:59, 12 July 2011
r92018Follow-up to r86811 and r92013 - instead of using class_exists() or MWInit::c...yaron23:11, 12 July 2011

Status & tagging log