summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Bug.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Bugzilla/Bug.pm')
-rw-r--r--Bugzilla/Bug.pm11
1 files changed, 8 insertions, 3 deletions
diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm
index cfc01ba7b..d941a766e 100644
--- a/Bugzilla/Bug.pm
+++ b/Bugzilla/Bug.pm
@@ -2853,11 +2853,16 @@ sub GetComments {
INNER JOIN profiles
ON profiles.userid = longdescs.who
WHERE longdescs.bug_id = ?';
+
if ($start) {
- $query .= ' AND longdescs.bug_when > ?
- AND longdescs.bug_when <= ?';
- push(@args, ($start, $end));
+ $query .= ' AND longdescs.bug_when > ?';
+ push(@args, $start);
+ }
+ if ($end) {
+ $query .= ' AND longdescs.bug_when <= ?';
+ push(@args, $end);
}
+
$query .= " ORDER BY longdescs.bug_when $sort_order";
my $sth = $dbh->prepare($query);
$sth->execute(@args);