mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/ConfirmEdit
synced 2024-11-28 01:50:18 +00:00
MathCaptcha requires the texvc functions, which are now in the Math extension.
This commit is contained in:
parent
2894a23d5e
commit
4d62315053
|
@ -39,7 +39,11 @@ class MathCaptcha extends SimpleCaptcha {
|
||||||
|
|
||||||
/** Fetch the math */
|
/** Fetch the math */
|
||||||
function fetchMath( $sum ) {
|
function fetchMath( $sum ) {
|
||||||
|
if( MWInit::classExists( 'MathRenderer' ) ){
|
||||||
$math = new MathRenderer( $sum );
|
$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 );
|
$math->setOutputMode( MW_MATH_PNG );
|
||||||
$html = $math->render();
|
$html = $math->render();
|
||||||
return preg_replace( '/alt=".*?"/', '', $html );
|
return preg_replace( '/alt=".*?"/', '', $html );
|
||||||
|
|
Loading…
Reference in a new issue