|
|
@ -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 |
|
|
|