From efc5487dd674a69433365700ded382a6165206f3 Mon Sep 17 00:00:00 2001 From: evazion Date: Wed, 31 Jul 2019 21:47:31 -0500 Subject: [PATCH] Fix #4109: Censored images leaked in og:image attribute. --- app/logical/post_sets/post.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/logical/post_sets/post.rb b/app/logical/post_sets/post.rb index ece388494..6e8c75193 100644 --- a/app/logical/post_sets/post.rb +++ b/app/logical/post_sets/post.rb @@ -191,7 +191,7 @@ module PostSets def best_post # be smarter about this in the future - posts.max {|a, b| a.fav_count <=> b.fav_count} + posts.reject(&:is_deleted).select(&:visible?).max_by(&:fav_count) end end end