r44084 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r44083‎ | r44084 | r44085 >
Date:17:33, 30 November 2008
Author:pinky
Status:ok
Tags:
Comment:
Fixed minor bug where the memcached value for how many accounts an IP had
created that day would be increased even if $wgAccountCreationThrottle was
hit. This meant if an IP hit the throttle and then the throttle was raised
later that day, the IP still couldn't create another account, because it
had marked them as having created another account, when their last account
creation had actually failed.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/specials/SpecialUserlogin.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialUserlogin.php
@@ -311,14 +311,15 @@
312312
313313 if ( $wgAccountCreationThrottle && $wgUser->isPingLimitable() ) {
314314 $key = wfMemcKey( 'acctcreate', 'ip', $ip );
315 - $value = $wgMemc->incr( $key );
 315+ $value = $wgMemc->get( $key );
316316 if ( !$value ) {
317 - $wgMemc->set( $key, 1, 86400 );
 317+ $wgMemc->set( $key, 0, 86400 );
318318 }
319 - if ( $value > $wgAccountCreationThrottle ) {
 319+ if ( $value >= $wgAccountCreationThrottle ) {
320320 $this->throttleHit( $wgAccountCreationThrottle );
321321 return false;
322322 }
 323+ $wgMemc->incr( $key );
323324 }
324325
325326 if( !$wgAuth->addUser( $u, $this->mPassword, $this->mEmail, $this->mRealName ) ) {
Index: trunk/phase3/RELEASE-NOTES
@@ -377,6 +377,12 @@
378378 now automatically removed from titles; these characters can accidentally end
379379 up in copy-and-pasted titles, and, by overriding normal bidirectional text
380380 handling, can lead to annoying behavior such as text rendering backwards
 381+* Fixed minor bug where the memcached value for how many accounts an IP had
 382+ created that day would be increased even if $wgAccountCreationThrottle was
 383+ hit. This meant if an IP hit the throttle and then the throttle was raised
 384+ later that day, the IP still couldn't create another account, because it
 385+ had marked them as having created another account, when their last account
 386+ creation had actually failed.
381387
382388 === API changes in 1.14 ===
383389

Follow-up revisions

RevisionCommit summaryAuthorDate
r44824adding Nathaniel Herman into CREDITS (r44084, r44213)ashley02:02, 20 December 2008

Status & tagging log