Limit ip-all/subnet-all ping limts per wiki
authorcsteipp <csteipp@wikimedia.org>
Tue, 9 Feb 2016 01:44:06 +0000 (17:44 -0800)
committerLegoktm <legoktm.wikipedia@gmail.com>
Tue, 9 Feb 2016 09:38:55 +0000 (09:38 +0000)
47973faa7c7d4832 used a static string for ip-all/subnet-all limits,
instead of generating a key unique to each wiki.

Change-Id: Ie8013dc959fdeba92ecd463550e3d98d83276004

includes/user/User.php

index da63075..6638fb7 100644 (file)
@@ -1789,14 +1789,14 @@ class User implements IDBAccessObject {
                        // ip-based limits
                        if ( isset( $limits['ip'] ) ) {
                                $ip = $this->getRequest()->getIP();
-                               $keys["mediawiki:limiter:$action:ip:$ip"] = $limits['ip'];
+                               $keys[wfMemcKey( 'limiter', $action, 'ip', $ip )] = $limits['ip'];
                        }
                        // subnet-based limits
                        if ( isset( $limits['subnet'] ) ) {
                                $ip = $this->getRequest()->getIP();
                                $subnet = IP::getSubnet( $ip );
                                if ( $subnet !== false ) {
-                                       $keys["mediawiki:limiter:$action:subnet:$subnet"] = $limits['subnet'];
+                                       $keys[wfMemcKey( 'limiter', $action, 'subnet', $subnet )] = $limits['subnet'];
                                }
                        }
                }