summaryrefslogtreecommitdiffstats
path: root/Bug.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Bug.pm')
-rwxr-xr-xBug.pm11
1 files changed, 6 insertions, 5 deletions
diff --git a/Bug.pm b/Bug.pm
index 670b274eb..96ff0b8af 100755
--- a/Bug.pm
+++ b/Bug.pm
@@ -1,4 +1,3 @@
-#!/usr/bonsaitools/bin/perl -w
# -*- Mode: perl; indent-tabs-mode: nil -*-
#
# The contents of this file are subject to the Mozilla Public
@@ -75,10 +74,12 @@ sub initBug {
my $self = shift();
my ($bug_id, $user_id) = (@_);
-
- if ( (! defined $bug_id) || (!$bug_id) ) {
- # no bug number given
- return {};
+ my $old_bug_id = $bug_id;
+ if ((! defined $bug_id) || (!$bug_id) || (!&::detaint_natural($bug_id))) {
+ # no bug number given
+ $self->{'bug_id'} = $old_bug_id;
+ $self->{'error'} = "InvalidBugId";
+ return $self;
}
# default userid 0, or get DBID if you used an email address