summaryrefslogtreecommitdiffstats
path: root/Bugzilla
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2005-06-21 05:16:32 +0200
committerlpsolit%gmail.com <>2005-06-21 05:16:32 +0200
commitb0dd1758b2b72126b67afc36ebb0bb9cc36628ab (patch)
tree5dd5f248410a689c91d9cf02e706cfc65ea76474 /Bugzilla
parent4436350287ea47c1714a2ae583895f04f84a6231 (diff)
downloadbugzilla-b0dd1758b2b72126b67afc36ebb0bb9cc36628ab.tar.gz
bugzilla-b0dd1758b2b72126b67afc36ebb0bb9cc36628ab.tar.xz
Bug 297794: initBug's verification of user_id being an email is bogus - Patch by Tiago R. Mello <timello@async.com.br> r=LpSolit a=myk
Diffstat (limited to 'Bugzilla')
-rwxr-xr-xBugzilla/Bug.pm14
1 files changed, 7 insertions, 7 deletions
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);