$index = $this->storeCaptcha( array( 'answer' => $answer ) );
$form = '<table><tr><td>' . $this->fetchMath( $sum ) . '</td>';
- $form .= '<td>' . Xml::input( 'wpCaptchaWord', false, false, array( 'tabindex' => '1' ) ) . '</td></tr></table>';
+ $form .= '<td>' . Html::input( 'wpCaptchaWord', false, false, array( 'tabindex' => '1', 'required' ) ) . '</td></tr></table>';
$form .= Html::hidden( 'wpCaptchaId', $index );
return $form;
}
/** Fetch the math */
function fetchMath( $sum ) {
- if ( class_exists( 'MathRenderer' ) ){
+ if( MWInit::classExists( 'MathRenderer' ) ){
$math = new MathRenderer( $sum );
} else {
throw new MWException( 'MathCaptcha requires the Math extension for MediaWiki versions 1.18 and above.' );