X-Git-Url: https://git.toastfreeware.priv.at/toast/cookiecaptcha.git/blobdiff_plain/c112c24f54cce653e9089fdaff2bf7e691a8a248..04872c6af8f0783f6cbf37e96bfc7b9074a4dd5b:/MathCaptcha.class.php diff --git a/MathCaptcha.class.php b/MathCaptcha.class.php index a51e7fa..9b9cde2 100644 --- a/MathCaptcha.class.php +++ b/MathCaptcha.class.php @@ -7,25 +7,26 @@ class MathCaptcha extends SimpleCaptcha { return (int)$answer == (int)$info['answer']; } - function addCaptchaAPI(&$resultArr) { + function addCaptchaAPI( &$resultArr ) { list( $sum, $answer ) = $this->pickSum(); - $index = $this->storeCaptcha( array('answer' => $answer ) ); + $index = $this->storeCaptcha( array( 'answer' => $answer ) ); $resultArr['captcha']['type'] = 'math'; + $resultArr['captcha']['mime'] = 'text/tex'; $resultArr['captcha']['id'] = $index; - $resultArr['captcha']['sum'] = $sum; + $resultArr['captcha']['question'] = $sum; } - + /** Produce a nice little form */ function getForm() { list( $sum, $answer ) = $this->pickSum(); $index = $this->storeCaptcha( array( 'answer' => $answer ) ); - + $form = '
' . $this->fetchMath( $sum ) . ' | '; - $form .= '' . wfInput( 'wpCaptchaAnswer', false, false, array( 'tabindex' => '1' ) ) . ' |