summaryrefslogtreecommitdiffstats
path: root/process_bug.cgi
diff options
context:
space:
mode:
authorterry%mozilla.org <>2000-02-02 08:48:13 +0100
committerterry%mozilla.org <>2000-02-02 08:48:13 +0100
commit6133b82636f84fe8c0b2370a452117fbb95ec5c7 (patch)
tree47a33a90ed3194aa89dce76486083957fff8875e /process_bug.cgi
parentd1f6ec73e370d43bea603aeec8537bcf4555eddc (diff)
downloadbugzilla-6133b82636f84fe8c0b2370a452117fbb95ec5c7.tar.gz
bugzilla-6133b82636f84fe8c0b2370a452117fbb95ec5c7.tar.xz
Nothing was checking that the bug number you entered for a duplicate
bug was actually a legal bug number.
Diffstat (limited to 'process_bug.cgi')
-rwxr-xr-xprocess_bug.cgi16
1 files changed, 9 insertions, 7 deletions
diff --git a/process_bug.cgi b/process_bug.cgi
index d5ae66c39..b9be355b2 100755
--- a/process_bug.cgi
+++ b/process_bug.cgi
@@ -358,27 +358,29 @@ SWITCH: for ($::FORM{'knob'}) {
CheckFormFieldDefined(\%::FORM,'dup_id');
}
my $num = trim($::FORM{'dup_id'});
- if ($num !~ /^[0-9]*$/) {
+ SendSQL("SELECT bug_id FROM bugs WHERE bug_id = " . SqlQuote($num));
+ $num = FetchOneColumn();
+ if (!$num) {
print "You must specify a bug number of which this bug is a\n";
print "duplicate. The bug has not been changed.\n";
PutFooter();
exit;
}
- if (defined($::FORM{'id'}) && $::FORM{'dup_id'} == $::FORM{'id'}) {
+ if (!defined($::FORM{'id'}) || $num == $::FORM{'id'}) {
print "Nice try, $::FORM{'who'}. But it doesn't really make sense to mark a\n";
print "bug as a duplicate of itself, does it?\n";
PutFooter();
exit;
}
- AppendComment($::FORM{'dup_id'}, $::FORM{'who'}, "*** Bug $::FORM{'id'} has been marked as a duplicate of this bug. ***");
+ AppendComment($num, $::FORM{'who'}, "*** Bug $::FORM{'id'} has been marked as a duplicate of this bug. ***");
if ( Param('strictvaluechecks') ) {
CheckFormFieldDefined(\%::FORM,'comment');
}
- $::FORM{'comment'} .= "\n\n*** This bug has been marked as a duplicate of $::FORM{'dup_id'} ***";
+ $::FORM{'comment'} .= "\n\n*** This bug has been marked as a duplicate of $num ***";
- print "<TABLE BORDER=1><TD><H2>Notation added to bug $::FORM{'dup_id'}</H2>\n";
- system("./processmail $::FORM{'dup_id'} $::FORM{'who'}");
- print "<TD><A HREF=\"show_bug.cgi?id=$::FORM{'dup_id'}\">Go To BUG# $::FORM{'dup_id'}</A></TABLE>\n";
+ print "<TABLE BORDER=1><TD><H2>Notation added to bug $num</H2>\n";
+ system("./processmail $num $::FORM{'who'}");
+ print "<TD><A HREF=\"show_bug.cgi?id=$num\">Go To BUG# $num</A></TABLE>\n";
last SWITCH;
};