Don't check badlogin attempts in memcached if we are not configured to show captchas...
authorPlatonides <platonides@users.mediawiki.org>
Wed, 21 Dec 2011 23:39:53 +0000 (23:39 +0000)
committerPlatonides <platonides@users.mediawiki.org>
Wed, 21 Dec 2011 23:39:53 +0000 (23:39 +0000)
Solves problem reported in http://www.mediawiki.org/w/index.php?title=Extension_talk:ConfirmEdit&offset=20111218172150#Banned_user_got_banned_until_he_logs_in_9982
where "$wgCaptchaTriggers['badlogin'] = false was set to disable that captcha, but as the user had already passed the threshold, it still was shown.

Captcha.php

index 941ec0e0d8c3aa12f52fbb9a8f282cc21b18062a..23e12d992b23d60464a180643cc415920f8dcd2b 100644 (file)
@@ -168,8 +168,8 @@ class SimpleCaptcha {
         * @access private
         */
        function isBadLoginTriggered() {
-               global $wgMemc, $wgCaptchaBadLoginAttempts;
-               return intval( $wgMemc->get( $this->badLoginKey() ) ) >= $wgCaptchaBadLoginAttempts;
+               global $wgMemc, $wgCaptchaTriggers, $wgCaptchaBadLoginAttempts;
+               return $wgCaptchaTriggers['badlogin'] && intval( $wgMemc->get( $this->badLoginKey() ) ) >= $wgCaptchaBadLoginAttempts;
        }
 
        /**