r107007 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r107006‎ | r107007 | r107008 >
Date:23:39, 21 December 2011
Author:platonides
Status:ok
Tags:
Comment:
Don't check badlogin attempts in memcached if we are not configured to show captchas on bad login.

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.
Modified paths:
  • /trunk/extensions/ConfirmEdit/Captcha.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ConfirmEdit/Captcha.php
@@ -168,8 +168,8 @@
169169 * @access private
170170 */
171171 function isBadLoginTriggered() {
172 - global $wgMemc, $wgCaptchaBadLoginAttempts;
173 - return intval( $wgMemc->get( $this->badLoginKey() ) ) >= $wgCaptchaBadLoginAttempts;
 172+ global $wgMemc, $wgCaptchaTriggers, $wgCaptchaBadLoginAttempts;
 173+ return $wgCaptchaTriggers['badlogin'] && intval( $wgMemc->get( $this->badLoginKey() ) ) >= $wgCaptchaBadLoginAttempts;
174174 }
175175
176176 /**

Status & tagging log