r36959 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r36958‎ | r36959 | r36960 >
Date:23:09, 2 July 2008
Author:simetrical
Status:old
Tags:
Comment:
* Change $wgCaptchaBadLoginAttempts to be inclusive of the first attempt, so that the old default is 1. 0 now really means that 0 bad logins are tolerated before the captcha is displayed, i.e., it's always displayed even with no bad logins. This seems to make more sense (certainly compared to setting it to -1 to always display the captcha).
* Set the default to 3 instead of 1, to be more forgiving of mistyped passwords. Unlikely to help bots much; quite likely to help blind people who aren't really really really careful typers.
* Commit some whitespace change I had lying around.
Modified paths:
  • /trunk/extensions/ConfirmEdit/ConfirmEdit.php (modified) (history)
  • /trunk/extensions/ConfirmEdit/ConfirmEdit_body.php (modified) (history)
  • /trunk/extensions/LinkSearch/LinkSearch_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/LinkSearch/LinkSearch_body.php
@@ -6,7 +6,6 @@
77 }
88
99 function execute( $par ) {
10 -
1110 wfLoadExtensionMessages( 'LinkSearch' );
1211
1312 $this->setHeaders();
Index: trunk/extensions/ConfirmEdit/ConfirmEdit_body.php
@@ -205,7 +205,7 @@
206206 */
207207 function isBadLoginTriggered() {
208208 global $wgMemc, $wgCaptchaBadLoginAttempts;
209 - return intval( $wgMemc->get( $this->badLoginKey() ) ) > $wgCaptchaBadLoginAttempts;
 209+ return intval( $wgMemc->get( $this->badLoginKey() ) ) >= $wgCaptchaBadLoginAttempts;
210210 }
211211
212212 /**
Index: trunk/extensions/ConfirmEdit/ConfirmEdit.php
@@ -150,12 +150,11 @@
151151 $ceAllowConfirmedEmail = false;
152152
153153 /**
154 - * Number of bad login attempts allowed before triggering the captcha.
155 - *
156 - * Default is 0.
 154+ * Number of bad login attempts before triggering the captcha. 0 means the
 155+ * captcha is presented on the first login.
157156 */
158157 global $wgCaptchaBadLoginAttempts;
159 -$wgCaptchaBadLoginAttempts = 0;
 158+$wgCaptchaBadLoginAttempts = 3;
160159
161160 /**
162161 * Regex to whitelist URLs to known-good sites...

Status & tagging log