]> ToastFreeware Gitweb - toast/cookiecaptcha.git/blobdiff - MathCaptcha.class.php
Localisation updates for extension messages from translatewiki.net (2009-05-12 18...
[toast/cookiecaptcha.git] / MathCaptcha.class.php
index db506a335451b784ea1764057a202942fcf25590..9348d873b28b68251ea452a0b2428650a5b3b04c 100644 (file)
@@ -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 = '<table><tr><td>' . $this->fetchMath( $sum ) . '</td>';
-               $form .= '<td>' . wfInput( 'wpCaptchaAnswer', false, false, array( 'tabindex' => '1' ) ) . '</td></tr></table>';
-               $form .= wfHidden( 'wpCaptchaId', $index );
+               $form .= '<td>' . Xml::input( 'wpCaptchaWord', false, false, array( 'tabindex' => '1' ) ) . '</td></tr></table>';
+               $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 );
        }
 
 }