Change-Id: Iffb4d85dfed740b01fcef5a25762dc751b292c41
$id = $this->getId();
$userLimit = false;
$isNewbie = $this->isNewbie();
$id = $this->getId();
$userLimit = false;
$isNewbie = $this->isNewbie();
+ $cache = ObjectCache::getLocalClusterInstance();
if ( $id == 0 ) {
// limits for anons
if ( isset( $limits['anon'] ) ) {
if ( $id == 0 ) {
// limits for anons
if ( isset( $limits['anon'] ) ) {
- $keys[wfMemcKey( 'limiter', $action, 'anon' )] = $limits['anon'];
+ $keys[$cache->makeKey( 'limiter', $action, 'anon' )] = $limits['anon'];
}
} else {
// limits for logged-in users
}
} else {
// limits for logged-in users
}
// limits for newbie logged-in users
if ( $isNewbie && isset( $limits['newbie'] ) ) {
}
// limits for newbie logged-in users
if ( $isNewbie && isset( $limits['newbie'] ) ) {
- $keys[wfMemcKey( 'limiter', $action, 'user', $id )] = $limits['newbie'];
+ $keys[$cache->makeKey( 'limiter', $action, 'user', $id )] = $limits['newbie'];
if ( $userLimit !== false ) {
list( $max, $period ) = $userLimit;
wfDebug( __METHOD__ . ": effective user limit: $max in {$period}s\n" );
if ( $userLimit !== false ) {
list( $max, $period ) = $userLimit;
wfDebug( __METHOD__ . ": effective user limit: $max in {$period}s\n" );
- $keys[wfMemcKey( 'limiter', $action, 'user', $id )] = $userLimit;
+ $keys[$cache->makeKey( 'limiter', $action, 'user', $id )] = $userLimit;
}
// ip-based limits for all ping-limitable users
}
// ip-based limits for all ping-limitable users
- $cache = ObjectCache::getLocalClusterInstance();
-
$triggered = false;
foreach ( $keys as $key => $limit ) {
list( $max, $period ) = $limit;
$triggered = false;
foreach ( $keys as $key => $limit ) {
list( $max, $period ) = $limit;