r92937 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r92936‎ | r92937 | r92938 >
Date:09:49, 23 July 2011
Author:aaron
Status:ok (Comments)
Tags:
Comment:
Dummy-proof incLoginThrottle/clearLoginThrottle with trim()
Modified paths:
  • /trunk/phase3/includes/specials/SpecialUserlogin.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialUserlogin.php
@@ -589,6 +589,7 @@
590590 */
591591 public static function incLoginThrottle( $username ) {
592592 global $wgPasswordAttemptThrottle, $wgMemc;
 593+ $username = trim( $username ); // sanity
593594
594595 $throttleCount = 0;
595596 if ( is_array( $wgPasswordAttemptThrottle ) ) {
@@ -616,6 +617,7 @@
617618 */
618619 public static function clearLoginThrottle( $username ) {
619620 global $wgMemc;
 621+ $username = trim( $username ); // sanity
620622
621623 $throttleKey = wfMemcKey( 'password-throttle', wfGetIP(), md5( $username ) );
622624 $wgMemc->delete( $throttleKey );

Follow-up revisions

RevisionCommit summaryAuthorDate
r92938MFT r92937aaron09:51, 23 July 2011

Comments

#Comment by Aaron Schulz (talk | contribs)   09:54, 23 July 2011

Unit tests might be nice to prevent this from coming up again.

Status & tagging log