From 8d2b07ea05e895f040d1805221135bfb68dc7f7c Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" <> Date: Thu, 31 Dec 2009 12:53:19 +0000 Subject: Bug 527586: Use X-Forwarded-For instead of REMOTE_ADDR for trusted proxies Patch by Max Kanat-Alexander r=dkl, a=mkanat --- Bugzilla/Token.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Bugzilla/Token.pm') diff --git a/Bugzilla/Token.pm b/Bugzilla/Token.pm index 4aee0561e..2cd9e3f9c 100644 --- a/Bugzilla/Token.pm +++ b/Bugzilla/Token.pm @@ -142,7 +142,7 @@ sub IssuePasswordToken { ThrowUserError('too_soon_for_new_token', {'type' => 'password'}) if $too_soon; - my ($token, $token_ts) = _create_token($user->id, 'password', $::ENV{'REMOTE_ADDR'}); + my ($token, $token_ts) = _create_token($user->id, 'password', remote_ip()); # Mail the user the token along with instructions for using it. my $template = Bugzilla->template_inner($user->settings->{'lang'}->{'value'}); @@ -283,7 +283,7 @@ sub Cancel { my $user = new Bugzilla::User($userid); $vars->{'emailaddress'} = $userid ? $user->email : $eventdata; - $vars->{'remoteaddress'} = $::ENV{'REMOTE_ADDR'}; + $vars->{'remoteaddress'} = remote_ip(); $vars->{'token'} = $token; $vars->{'tokentype'} = $tokentype; $vars->{'issuedate'} = $issuedate; -- cgit v1.2.3-24-g4f1b