From 0a5e08ebe765fe9b3d23b4aaef647368d8810b21 Mon Sep 17 00:00:00 2001 From: multiple creatures Date: Sat, 1 Feb 2020 10:52:51 -0600 Subject: **MAJOR**: fix access policy short-circuit bug caused by `fa8437f49` & `cb38a5899` - **if you are running a monsterfork revision between `fa8437f49` and `389125d89` upgrade or apply this patch immediately! --- app/lib/status_filter.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'app') diff --git a/app/lib/status_filter.rb b/app/lib/status_filter.rb index 6d65e2c00..80254ffb4 100644 --- a/app/lib/status_filter.rb +++ b/app/lib/status_filter.rb @@ -13,13 +13,15 @@ class StatusFilter end def filtered? - return true if status.nil? - return false if !account.nil? && account.id == status.account_id || account.nil? + return true if status.nil? || blocked_by_policy? + return false if account.nil? || account.id == status.account_id return true if redis.sismember("filtered_statuses:#{account.id}", status.id) - if blocked_by_policy? || (account_present? && filtered_status?) || silenced_account? + + if filtered_status? || silenced_account? redis.sadd("filtered_statuses:#{account.id}", status.id) return true end + false end -- cgit