From b0dd1758b2b72126b67afc36ebb0bb9cc36628ab Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Tue, 21 Jun 2005 03:16:32 +0000 Subject: Bug 297794: initBug's verification of user_id being an email is bogus - Patch by Tiago R. Mello r=LpSolit a=myk --- Bugzilla/Bug.pm | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'Bugzilla/Bug.pm') diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm index 7cfd1b382..39864d252 100755 --- a/Bugzilla/Bug.pm +++ b/Bugzilla/Bug.pm @@ -137,14 +137,14 @@ sub initBug { return $self; } -# default userid 0, or get DBID if you used an email address - unless (defined $user_id) { + # If the user is not logged in, sets $user_id to 0. + # Else gets $user_id from the user login name if this + # argument is not numeric. + my $stored_user_id = $user_id; + if (!defined $user_id) { $user_id = 0; - } - else { - if ($user_id =~ /^\@/) { - $user_id = login_to_id($user_id); - } + } elsif (!detaint_natural($user_id)) { + $user_id = login_to_id($stored_user_id); } $self->{'who'} = new Bugzilla::User($user_id); -- cgit v1.2.3-24-g4f1b