r92901 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r92900‎ | r92901 | r92902 >
Date:21:51, 22 July 2011
Author:demon
Status:ok
Tags:
Comment:
Revert r92864 per discussion on CR
Modified paths:
  • /trunk/extensions/ConfirmEdit/MathCaptcha.class.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ConfirmEdit/MathCaptcha.class.php
@@ -39,17 +39,11 @@
4040
4141 /** Fetch the math */
4242 function fetchMath( $sum ) {
43 - // class_exists() unfortunately doesn't work with HipHop, and
44 - // its replacement, MWInit::classExists(), wasn't added until
45 - // MW 1.18, and is thus unusable here - so instead, we'll
46 - // just duplicate the code of MWInit::classExists().
47 - try {
48 - $r = new ReflectionClass( 'MathRenderer' );
49 - } catch( ReflectionException $r ) {
 43+ if( MWInit::classExists( 'MathRenderer' ) ){
 44+ $math = new MathRenderer( $sum );
 45+ } else {
5046 throw new MWException( 'MathCaptcha requires the Math extension for MediaWiki versions 1.18 and above.' );
5147 }
52 -
53 - $math = new MathRenderer( $sum );
5448 $math->setOutputMode( MW_MATH_PNG );
5549 $html = $math->render();
5650 return preg_replace( '/alt=".*?"/', '', $html );

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r92864Undoing r92755 - if you want to revert these changes, please let's discuss it...yaron16:49, 22 July 2011

Status & tagging log