Index: trunk/extensions/AbuseFilter/AbuseFilter.class.php |
— | — | @@ -1523,7 +1523,12 @@ |
1524 | 1524 | $vars->setVar( 'ACTION', 'createaccount' ); |
1525 | 1525 | |
1526 | 1526 | $name = Title::makeTitle( $row->rc_namespace, $row->rc_title )->getText(); |
1527 | | - $vars->setVar( 'user_name', $name ); |
| 1527 | + // Add user data if the account was created by a registered user |
| 1528 | + if ( $row->rc_user && $name != $row->rc_user_text ) { |
| 1529 | + $user = User::newFromName( $row->rc_user_text ); |
| 1530 | + $vars->addHolder( self::generateUserVars( $user ) ); |
| 1531 | + } |
| 1532 | + |
1528 | 1533 | $vars->setVar( 'accountname', $name ); |
1529 | 1534 | return $vars; |
1530 | 1535 | } |
Index: trunk/extensions/AbuseFilter/AbuseFilter.hooks.php |
— | — | @@ -105,6 +105,12 @@ |
106 | 106 | return false; |
107 | 107 | } |
108 | 108 | $vars = new AbuseFilterVariableHolder; |
| 109 | + // Add variables only for a registered user, so IP addresses of |
| 110 | + // new users won't be exposed |
| 111 | + global $wgUser; |
| 112 | + if ( $wgUser->getId() ) { |
| 113 | + $vars->addHolder( AbuseFilter::generateUserVars( $wgUser ) ); |
| 114 | + } |
109 | 115 | |
110 | 116 | $vars->setVar( 'ACTION', 'createaccount' ); |
111 | 117 | $vars->setVar( 'ACCOUNTNAME', $user->getName() ); |