]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 952284 - Tags set to private comments should not be disclosed to everybody in...
authorDave Lawrence <dlawrence@mozilla.com>
Thu, 2 Jan 2014 23:18:45 +0000 (18:18 -0500)
committerDave Lawrence <dlawrence@mozilla.com>
Thu, 2 Jan 2014 23:18:45 +0000 (18:18 -0500)
r=LpSolit,a=sgreen

Bugzilla/Bug.pm

index f0476c898ce7fb6cdae863b440ea57a3501aefea..b4e8c361a574e74a6fec8b497d3507aad2410a56 100644 (file)
@@ -3872,6 +3872,15 @@ sub get_activity {
         && $include_comment_tags
         && !$attach_id)
     {
+        # Only includes comment tag activity for comments the user is allowed to see.
+        $suppjoins = "";
+        $suppwhere = "";
+        if (!Bugzilla->user->is_insider) {
+            $suppjoins = "INNER JOIN longdescs
+                          ON longdescs.comment_id = longdescs_tags_activity.comment_id";
+            $suppwhere = "AND longdescs.isprivate = 0";
+        }
+
         $query .= "
             UNION ALL
             SELECT 'comment_tag' AS name,
@@ -3883,8 +3892,10 @@ sub get_activity {
                    longdescs_tags_activity.comment_id as comment_id
               FROM longdescs_tags_activity
                    INNER JOIN profiles ON profiles.userid = longdescs_tags_activity.who
+                   $suppjoins
              WHERE longdescs_tags_activity.bug_id = ?
                    $datepart
+                   $suppwhere
         ";
         push @args, $self->id;
         push @args, $starttime if defined $starttime;