Brian Wolff has uploaded a new change for review.
https://gerrit.wikimedia.org/r/270662
Change subject: Use global cache keys login/create account rate limitting
......................................................................
Use global cache keys login/create account rate limitting
If you are running multiple wikis, you probably want the rate limit
on one wiki to apply to all wikis
Bug: T126685
Change-Id: Id662742c7af1b26811f5b0aa199176cb9a7658d9
---
M includes/specials/SpecialUserlogin.php
1 file changed, 4 insertions(+), 4 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/62/270662/1
diff --git a/includes/specials/SpecialUserlogin.php
b/includes/specials/SpecialUserlogin.php
index 05e5229..0273484 100644
--- a/includes/specials/SpecialUserlogin.php
+++ b/includes/specials/SpecialUserlogin.php
@@ -649,7 +649,7 @@
"allowed account creation w/o throttle\n" );
} else {
if ( ( $wgAccountCreationThrottle &&
$currentUser->isPingLimitable() ) ) {
- $key = wfMemcKey( 'acctcreate', 'ip', $ip );
+ $key = wfGlobalCacheKey( 'acctcreate', 'ip',
$ip );
$value = $cache->get( $key );
if ( !$value ) {
$cache->set( $key, 0, $cache::TTL_DAY );
@@ -890,7 +890,7 @@
$throttleCount = 0;
if ( is_array( $wgPasswordAttemptThrottle ) ) {
- $throttleKey = wfMemcKey( 'password-throttle',
$wgRequest->getIP(), md5( $username ) );
+ $throttleKey = wfGlobalCacheKey( 'password-throttle',
$wgRequest->getIP(), md5( $username ) );
$count = $wgPasswordAttemptThrottle['count'];
$period = $wgPasswordAttemptThrottle['seconds'];
@@ -917,7 +917,7 @@
global $wgRequest;
$username = trim( $username ); // sanity
- $throttleKey = wfMemcKey( 'password-throttle',
$wgRequest->getIP(), md5( $username ) );
+ $throttleKey = wfGlobalCacheKey( 'password-throttle',
$wgRequest->getIP(), md5( $username ) );
ObjectCache::getLocalClusterInstance()->delete( $throttleKey );
}
@@ -1000,7 +1000,7 @@
// Reset the throttle
$request = $this->getRequest();
- $key = wfMemcKey( 'password-throttle',
$request->getIP(), md5( $this->mUsername ) );
+ $key = wfGlobalCacheKey( 'password-throttle',
$request->getIP(), md5( $this->mUsername ) );
$cache->delete( $key );
if ( $this->hasSessionCookie() ||
$this->mSkipCookieCheck ) {
--
To view, visit https://gerrit.wikimedia.org/r/270662
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id662742c7af1b26811f5b0aa199176cb9a7658d9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Brian Wolff <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits