Added rate limiter for Special:Emailuser
authorTim Starling <tstarling@users.mediawiki.org>
Sat, 24 Feb 2007 21:34:08 +0000 (21:34 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Sat, 24 Feb 2007 21:34:08 +0000 (21:34 +0000)
RELEASE-NOTES
includes/DefaultSettings.php
includes/SpecialEmailuser.php

index 1c07e12..15e1d1a 100644 (file)
@@ -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 ==
 
index 6db13e9..ec8a660 100644 (file)
@@ -2209,6 +2209,9 @@ $wgRateLimits = array(
        'mailpassword' => array(
                'anon' => NULL,
                ),
+       'emailuser' => array(
+               'user' => null,
+               ),
        );
 
 /**
index 80ae1ef..def1030 100644 (file)
@@ -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 ) {