diff options
Diffstat (limited to 'Bugzilla')
-rwxr-xr-x | Bugzilla/Bug.pm | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm index 91a92cbe2..857557def 100755 --- a/Bugzilla/Bug.pm +++ b/Bugzilla/Bug.pm @@ -107,13 +107,6 @@ sub initBug { # If the bug ID isn't numeric, it might be an alias, so try to convert it. $bug_id = bug_alias_to_id($bug_id) if $bug_id !~ /^0*[1-9][0-9]*$/; - if ((! defined $bug_id) || (!$bug_id) || (!detaint_natural($bug_id))) { - # no bug number given or the alias didn't match a bug - $self->{'bug_id'} = $old_bug_id; - $self->{'error'} = "InvalidBugId"; - return $self; - } - # 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. @@ -126,6 +119,13 @@ sub initBug { $self->{'who'} = new Bugzilla::User($user_id); + if ((! defined $bug_id) || (!$bug_id) || (!detaint_natural($bug_id))) { + # no bug number given or the alias didn't match a bug + $self->{'bug_id'} = $old_bug_id; + $self->{'error'} = "InvalidBugId"; + return $self; + } + my $custom_fields = ""; if (scalar(Bugzilla->custom_field_names) > 0) { $custom_fields = ", " . join(", ", Bugzilla->custom_field_names); |