FIX: Don't include hidden posts in embedded comments

This commit is contained in:
Robin Ward 2016-05-03 15:01:20 -04:00
parent 2cc6efba8c
commit 664f1913c8
No known key found for this signature in database
GPG key ID: 0E091E2B4ED1B83D
2 changed files with 3 additions and 1 deletions

View file

@ -22,7 +22,8 @@ class EmbedController < ApplicationController
current_user,
limit: SiteSetting.embed_post_limit,
exclude_first: true,
exclude_deleted_users: true)
exclude_deleted_users: true,
exclude_hidden: true)
@second_post_url = "#{@topic_view.topic.url}/2" if @topic_view
@posts_left = 0

View file

@ -387,6 +387,7 @@ class TopicView
result = filter_post_types(@topic.posts)
result = result.with_deleted if @guardian.can_see_deleted_posts?
result = @topic.posts.where("user_id IS NOT NULL") if @exclude_deleted_users
result = @topic.posts.where(hidden: false) if @exclude_hidden
result
end