diff options
author | lpsolit%gmail.com <> | 2007-11-30 02:49:12 +0100 |
---|---|---|
committer | lpsolit%gmail.com <> | 2007-11-30 02:49:12 +0100 |
commit | f394b2ed4f175bf6076747ba7792e182841091ab (patch) | |
tree | d4ca1fcead500fd8edb40179e468423684fb7332 /Bugzilla/Bug.pm | |
parent | 5c9cb1c442e10faad5d5234f9c90f2a4529297be (diff) | |
download | bugzilla-f394b2ed4f175bf6076747ba7792e182841091ab.tar.gz bugzilla-f394b2ed4f175bf6076747ba7792e182841091ab.tar.xz |
Bug 99215: Attachments have no midair collision protection - Patch by Frédéric Buclin <LpSolit@gmail.com> r=mkanat r=justdave a=justdave
Diffstat (limited to 'Bugzilla/Bug.pm')
-rwxr-xr-x | Bugzilla/Bug.pm | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm index a8f1ede5d..0a45daf14 100755 --- a/Bugzilla/Bug.pm +++ b/Bugzilla/Bug.pm @@ -2573,11 +2573,11 @@ sub format_comment { # Get the activity of a bug, starting from $starttime (if given). # This routine assumes ValidateBugID has been previously called. sub GetBugActivity { - my ($id, $starttime) = @_; + my ($bug_id, $attach_id, $starttime) = @_; my $dbh = Bugzilla->dbh; # Arguments passed to the SQL query. - my @args = ($id); + my @args = ($bug_id); # Only consider changes since $starttime, if given. my $datepart = ""; @@ -2587,6 +2587,12 @@ sub GetBugActivity { $datepart = "AND bugs_activity.bug_when > ?"; } + my $attachpart = ""; + if ($attach_id) { + push(@args, $attach_id); + $attachpart = "AND bugs_activity.attach_id = ?"; + } + # Only includes attachments the user is allowed to see. my $suppjoins = ""; my $suppwhere = ""; @@ -2616,6 +2622,7 @@ sub GetBugActivity { ON profiles.userid = bugs_activity.who WHERE bugs_activity.bug_id = ? $datepart + $attachpart $suppwhere ORDER BY bugs_activity.bug_when"; |