diff options
author | ThibG <thib@sitedethib.com> | 2018-07-11 19:53:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-11 19:53:43 +0200 |
commit | 017628fd003e17df7ae28fe62db64abd2e6f680e (patch) | |
tree | c6cad9011fd1900dc1062b67b0db400418832ce8 /app/lib/feed_manager.rb | |
parent | 612b00d1bb91c6b11f00fdb273dd8cd2ca883b12 (diff) | |
parent | 6f0f583abeb34737f01defab5cdee7b626447f5e (diff) |
Merge pull request #567 from ThibG/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/lib/feed_manager.rb')
-rw-r--r-- | app/lib/feed_manager.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/lib/feed_manager.rb b/app/lib/feed_manager.rb index c247ab21d..14cba70dc 100644 --- a/app/lib/feed_manager.rb +++ b/app/lib/feed_manager.rb @@ -200,10 +200,11 @@ class FeedManager active_filters = Rails.cache.fetch("filters:#{receiver_id}") { CustomFilter.where(account_id: receiver_id).active_irreversible.to_a }.to_a active_filters.select! { |filter| filter.context.include?(context.to_s) && !filter.expired? } + active_filters.map! do |filter| if filter.whole_word sb = filter.phrase =~ /\A[[:word:]]/ ? '\b' : '' - eb = filter.phrase =~ /[[:word:]]\Z/ ? '\b' : '' + eb = filter.phrase =~ /[[:word:]]\z/ ? '\b' : '' /(?mix:#{sb}#{Regexp.escape(filter.phrase)}#{eb})/ else |