(bug 13918), make CAPTCHA less obtrusive. Added a new global $wgCaptchaBadLoginAttemp...
[toast/cookiecaptcha.git] / ConfirmEdit_body.php
index e905640cf23b8bafb119fecba564e462a397effc..31635dac4323d4c7d2006320abb74bec78b5655f 100644 (file)
@@ -83,6 +83,7 @@ class SimpleCaptcha {
                $captcha = $this->getCaptcha();
                $index = $this->storeCaptcha( $captcha );
                $resultArr['captcha']['type'] = 'simple';
+               $resultArr['captcha']['mime'] = 'text/plain';
                $resultArr['captcha']['id'] = $index;
                $resultArr['captcha']['question'] = $captcha['question'];
        }
@@ -203,8 +204,8 @@ class SimpleCaptcha {
         * @access private
         */
        function isBadLoginTriggered() {
-               global $wgMemc;
-               return intval( $wgMemc->get( $this->badLoginKey() ) ) > 0;
+               global $wgMemc, $wgCaptchaBadLoginAttempts;
+               return intval( $wgMemc->get( $this->badLoginKey() ) ) > $wgCaptchaBadLoginAttempts;
        }
        
        /**
@@ -407,7 +408,7 @@ class SimpleCaptcha {
                        //$regex = 'http://+[a-z0-9_\-.]*(' . implode( '|', $lines ) . ')';
                        //return '/' . str_replace( '/', '\/', preg_replace('|\\\*/|', '/', $regex) ) . '/Si';
                        $regexes = '';
-                       $regexStart = '/http:\/\/+[a-z0-9_\-.]*(';
+                       $regexStart = '/^https?:\/\/+[a-z0-9_\-.]*(';
                        $regexEnd = ')/Si';
                        $regexMax = 4096;
                        $build = false;