X-Git-Url: https://git.toastfreeware.priv.at/toast/cookiecaptcha.git/blobdiff_plain/a808bd44dc345493d3baddee8a84e4c19fb6004f..e60e80a533c9f19d86579ef76ab69314d95c9570:/MathCaptcha.class.php diff --git a/MathCaptcha.class.php b/MathCaptcha.class.php index db506a3..9348d87 100644 --- a/MathCaptcha.class.php +++ b/MathCaptcha.class.php @@ -11,6 +11,7 @@ class MathCaptcha extends SimpleCaptcha { list( $sum, $answer ) = $this->pickSum(); $index = $this->storeCaptcha( array('answer' => $answer ) ); $resultArr['captcha']['type'] = 'math'; + $resultArr['captcha']['mime'] = 'text/tex'; $resultArr['captcha']['id'] = $index; $resultArr['captcha']['question'] = $sum; } @@ -21,8 +22,8 @@ class MathCaptcha extends SimpleCaptcha { $index = $this->storeCaptcha( array( 'answer' => $answer ) ); $form = ''; - $form .= '
' . $this->fetchMath( $sum ) . '' . wfInput( 'wpCaptchaAnswer', false, false, array( 'tabindex' => '1' ) ) . '
'; - $form .= wfHidden( 'wpCaptchaId', $index ); + $form .= '' . Xml::input( 'wpCaptchaWord', false, false, array( 'tabindex' => '1' ) ) . ''; + $form .= Xml::hidden( 'wpCaptchaId', $index ); return $form; } @@ -41,7 +42,7 @@ class MathCaptcha extends SimpleCaptcha { $math = new MathRenderer( $sum ); $math->setOutputMode( MW_MATH_PNG ); $html = $math->render(); - return preg_replace( '/alt=".*"/', '', $html ); + return preg_replace( '/alt=".*?"/', '', $html ); } }