summaryrefslogtreecommitdiffstats
path: root/process_bug.cgi
diff options
context:
space:
mode:
authorterry%mozilla.org <>2000-01-12 03:25:11 +0100
committerterry%mozilla.org <>2000-01-12 03:25:11 +0100
commit1f700c4d4825b7468b6c2cc82ccad269a9e3abfb (patch)
tree6f1b3dbc0fd0b2894e72d1b513551ac7c2a466db /process_bug.cgi
parent09035a1555ac79a74a3c40631701ae35dcd7f9fd (diff)
downloadbugzilla-1f700c4d4825b7468b6c2cc82ccad269a9e3abfb.tar.gz
bugzilla-1f700c4d4825b7468b6c2cc82ccad269a9e3abfb.tar.xz
Was making changes to bugs before validating the entries in the CC
field. This caused mid-air collisions and other weirdnesses.
Diffstat (limited to 'process_bug.cgi')
-rwxr-xr-xprocess_bug.cgi28
1 files changed, 19 insertions, 9 deletions
diff --git a/process_bug.cgi b/process_bug.cgi
index 3919dadb0..e72e9704b 100755
--- a/process_bug.cgi
+++ b/process_bug.cgi
@@ -248,6 +248,24 @@ if (defined $::FORM{'qa_contact'}) {
ConnectToDatabase();
+my %ccids;
+my $origcclist = "";
+
+# We make sure to check out the CC list before we actually start touching any
+# bugs.
+if (defined $::FORM{'cc'} && defined $::FORM{'id'}) {
+ $origcclist = ShowCcList($::FORM{'id'});
+ if ($origcclist ne $::FORM{'cc'}) {
+ foreach my $person (split(/[ ,]/, $::FORM{'cc'})) {
+ if ($person ne "") {
+ my $cid = DBNameToIdAndCheck($person);
+ $ccids{$cid} = 1;
+ }
+ }
+ }
+}
+
+
if ( Param('strictvaluechecks') ) {
CheckFormFieldDefined(\%::FORM, 'knob');
}
@@ -573,15 +591,7 @@ The changes made were:
AppendComment($id, $::FORM{'who'}, $::FORM{'comment'});
}
- if (defined $::FORM{'cc'} && ShowCcList($id) ne $::FORM{'cc'}) {
- my %ccids;
- foreach my $person (split(/[ ,]/, $::FORM{'cc'})) {
- if ($person ne "") {
- my $cid = DBNameToIdAndCheck($person);
- $ccids{$cid} = 1;
- }
- }
-
+ if (defined $::FORM{'cc'} && $origcclist ne $::FORM{'cc'}) {
SendSQL("delete from cc where bug_id = $id");
foreach my $ccid (keys %ccids) {
SendSQL("insert into cc (bug_id, who) values ($id, $ccid)");