summaryrefslogtreecommitdiff
path: root/extensions/ConfirmEdit/MathCaptcha.class.php
diff options
context:
space:
mode:
Diffstat (limited to 'extensions/ConfirmEdit/MathCaptcha.class.php')
-rw-r--r--extensions/ConfirmEdit/MathCaptcha.class.php7
1 files changed, 3 insertions, 4 deletions
diff --git a/extensions/ConfirmEdit/MathCaptcha.class.php b/extensions/ConfirmEdit/MathCaptcha.class.php
index 7874991f..ac220baa 100644
--- a/extensions/ConfirmEdit/MathCaptcha.class.php
+++ b/extensions/ConfirmEdit/MathCaptcha.class.php
@@ -22,7 +22,7 @@ class MathCaptcha extends SimpleCaptcha {
$index = $this->storeCaptcha( array( 'answer' => $answer ) );
$form = '<table><tr><td>' . $this->fetchMath( $sum ) . '</td>';
- $form .= '<td>' . Html::input( 'wpCaptchaWord', false, false, array( 'tabindex' => '1', 'required' ) ) . '</td></tr></table>';
+ $form .= '<td>' . Html::input( 'wpCaptchaWord', false, false, array( 'tabindex' => '1', 'autocomplete' => 'off', 'required' ) ) . '</td></tr></table>';
$form .= Html::hidden( 'wpCaptchaId', $index );
return $form;
}
@@ -39,12 +39,11 @@ class MathCaptcha extends SimpleCaptcha {
/** Fetch the math */
function fetchMath( $sum ) {
- if ( MWInit::classExists( 'MathRenderer' ) ) {
- $math = new MathRenderer( $sum );
+ if ( class_exists( 'MathRenderer' ) ) {
+ $math = MathRenderer::getRenderer( $sum, array(), MW_MATH_PNG );
} 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 );
}