From 3b82b71900d7f32e8c20e0d3c78e20fe1ecf9999 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Sat, 24 Feb 2007 21:34:08 +0000 Subject: [PATCH] Added rate limiter for Special:Emailuser --- RELEASE-NOTES | 1 + includes/DefaultSettings.php | 3 +++ includes/SpecialEmailuser.php | 6 ++++++ 3 files changed, 10 insertions(+) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 1c07e12fa0..15e1d1a07d 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -227,6 +227,7 @@ lighter making things easier to read. * (bug 8132) Suppress "Pages in this category" heading in categories when there are none * (bug 8958) Handle search operators better when using tsearch2 (Postgres) +* Added rate limiter for Special:Emailuser == Languages updated == diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 6db13e9dbc..ec8a660d7d 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -2209,6 +2209,9 @@ $wgRateLimits = array( 'mailpassword' => array( 'anon' => NULL, ), + 'emailuser' => array( + 'user' => null, + ), ); /** diff --git a/includes/SpecialEmailuser.php b/includes/SpecialEmailuser.php index 80ae1ef8dc..def1030279 100644 --- a/includes/SpecialEmailuser.php +++ b/includes/SpecialEmailuser.php @@ -45,6 +45,12 @@ function wfSpecialEmailuser( $par ) { return; } + # Check against the rate limiter + if( $wgUser->pingLimiter( 'emailuser' ) ) { + $wgOut->rateLimited(); + return; + } + $f = new EmailUserForm( $nu ); if ( "success" == $action ) { -- 2.20.1