FIX: don't onebox hidden posts

This commit is contained in:
Neil Lalonde
2014-04-28 11:03:19 -04:00
parent 340fd303c8
commit 9fba385172
2 changed files with 7 additions and 0 deletions

View File

@ -25,6 +25,7 @@ module Onebox
# Post Link
post = Post.where(topic_id: route[:topic_id], post_number: route[:post_number].to_i).first
return linked unless post
return linked if post.hidden
return linked unless Guardian.new.can_see?(post)
topic = post.topic