From 6b1f0fa6d210fa215b38aeb47af11a3c8f06e4da Mon Sep 17 00:00:00 2001 From: Platonides Date: Mon, 8 Nov 2010 20:51:15 +0000 Subject: [PATCH] Revert r72959 --- RELEASE-NOTES | 2 -- includes/DefaultSettings.php | 2 -- includes/User.php | 26 +------------------------- languages/messages/MessagesEn.php | 5 ----- maintenance/language/messages.inc | 1 - 5 files changed, 1 insertion(+), 35 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 60b535451f..3c52792c68 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -181,8 +181,6 @@ LocalSettings.php. The specific bugs are listed below in the general notes. * (bug 24007) Diff pages now mention the number of users having edited intermediate revisions * Added new hook GetIP -* (bug 16574) Allow administrators to temporarily disable the account creation - limit for IP addresses: [[MediaWiki:Ratelimit-excluded-ips]] * Special:Version now displays whether a SQLite database supports full-text search. * TS_ISO_8691_BASIC was added as a time format, which is used by ResourceLoader diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index e20c0ed75b..f103a885c3 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -3446,8 +3446,6 @@ $wgRateLimitsExcludedGroups = array(); /** * Array of IPs which should be excluded from rate limits. * This may be useful for whitelisting NAT gateways for conferences, etc. - * Wiki administrators can add additional IP addresses via - * [[MediaWiki:Ratelimit-excluded-ips]] */ $wgRateLimitsExcludedIPs = array(); diff --git a/includes/User.php b/includes/User.php index 63b1a6aa73..f101822a0b 100644 --- a/includes/User.php +++ b/includes/User.php @@ -1224,34 +1224,10 @@ class User { // Deprecated, but kept for backwards-compatibility config return false; } - - wfDebug( "Checking the list of IP addresses excluded from rate limit..\n" ); - - // Read list of IP addresses from MediaWiki namespace - $message = wfMsgForContentNoTrans( 'ratelimit-excluded-ips' ); - $lines = explode( "\n", $message ); - foreach( $lines as $line ) { - // Remove comment lines - $comment = substr( trim( $line ), 0, 1 ); - if ( $comment == '#' || $comment == '' ) { - continue; - } - // Remove additional comments after an IP address - $comment = strpos( $line, '#' ); - if ( $comment > 0 ) { - $line = trim( substr( $line, 0, $comment-1 ) ); - if ( IP::isValid( $line ) ) { - $wgRateLimitsExcludedIPs[] = IP::sanitizeIP( $line ); - } - } - } - - $ip = IP::sanitizeIP( wfGetIP() ); - if( in_array( $ip, $wgRateLimitsExcludedIPs ) ) { + if( in_array( wfGetIP(), $wgRateLimitsExcludedIPs ) ) { // No other good way currently to disable rate limits // for specific IPs. :P // But this is a crappy hack and should die. - wfDebug( "IP $ip matches the list of rate limit excluded IPs\n" ); return false; } return !$this->isAllowed('noratelimit'); diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 4b3ee2878b..f3361da216 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -1141,11 +1141,6 @@ Please wait before trying again.', * Italiano|it * Nederlands|nl', # do not translate or duplicate this message to other languages 'suspicious-userlogout' => 'Your request to log out was denied because it looks like it was sent by a broken browser or caching proxy.', -'ratelimit-excluded-ips' => ' #
-# Syntax is as follows:
-#   * Everything from a "#" character to the end of the line is a comment
-#   * Every non-blank line is an IP address excluded from the rate limit
- #
', # JavaScript password checks 'password-strength' => 'Estimated password strength: $1', diff --git a/maintenance/language/messages.inc b/maintenance/language/messages.inc index 639416727b..ce0405ead1 100644 --- a/maintenance/language/messages.inc +++ b/maintenance/language/messages.inc @@ -462,7 +462,6 @@ $wgMessageStructure = array( 'loginlanguagelabel', 'loginlanguagelinks', 'suspicious-userlogout', - 'ratelimit-excluded-ips', ), 'passwordstrength' => array( 'password-strength', -- 2.20.1