Don't check badlogin attempts in memcached if we are not configured to show captchas...
[toast/cookiecaptcha.git] / FancyCaptcha.class.php
index 75a8e81c89d19626f1fa2295c28f450f2b701c8d..26227aa30bc11fd0014bc8917e547d664d2baaa2 100644 (file)
@@ -44,7 +44,7 @@ class FancyCaptcha extends SimpleCaptcha {
        function getForm() {
                $info = $this->pickImage();
                if ( !$info ) {
-                       die( "out of captcha images; this shouldn't happen" );
+                       throw new MWException( "Ran out of captcha images" );
                }
 
                // Generate a random key for use of this captcha image in this session.
@@ -69,9 +69,10 @@ class FancyCaptcha extends SimpleCaptcha {
                                'id'    => 'wpCaptchaId',
                                'value' => $index ) ) .
                        "<p>" .
-                       Xml::element( 'input', array(
+                       Html::element( 'input', array(
                                'name' => 'wpCaptchaWord',
                                'id'   => 'wpCaptchaWord',
+                               'required',
                                'tabindex' => 1 ) ) . // tab in before the edit textarea
                        "</p>\n";
        }