From f394b2ed4f175bf6076747ba7792e182841091ab Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Fri, 30 Nov 2007 01:49:12 +0000 Subject: Bug 99215: Attachments have no midair collision protection - Patch by Frédéric Buclin r=mkanat r=justdave a=justdave MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Bugzilla/Bug.pm | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'Bugzilla/Bug.pm') 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"; -- cgit v1.2.3-24-g4f1b