about summary refs log tree commit diff
path: root/app/lib/feed_manager.rb
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2021-01-26 14:01:30 +0100
committerClaire <claire.github-309c@sitedethib.com>2021-01-26 14:01:30 +0100
commitb81710c02c9d8f27d417aa11b288a5b4e32bd5d5 (patch)
tree2f5ba10c2eb3c667dab2dfdb77c3d1724677ce87 /app/lib/feed_manager.rb
parentd1255ab8a5101bc04af4a5214f975edf443a37d9 (diff)
parent7f1c56954b46b26b4dadfa92047f1ee5d7f9ad0a (diff)
Merge branch 'main' into glitch-soc/merge-upstream
Conflicts:
- `CONTRIBUTING.md`:
  Not a real conflict, glitch-soc quotes the upstream file, which has been
  changed. Update the quote.
Diffstat (limited to 'app/lib/feed_manager.rb')
-rw-r--r--app/lib/feed_manager.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/lib/feed_manager.rb b/app/lib/feed_manager.rb
index ddd975c5f..2e70c2ce9 100644
--- a/app/lib/feed_manager.rb
+++ b/app/lib/feed_manager.rb
@@ -454,8 +454,8 @@ class FeedManager
 
     active_filters.map! do |filter|
       if filter.whole_word
-        sb = filter.phrase =~ /\A[[:word:]]/ ? '\b' : ''
-        eb = filter.phrase =~ /[[:word:]]\z/ ? '\b' : ''
+        sb = /\A[[:word:]]/.match?(filter.phrase) ? '\b' : ''
+        eb = /[[:word:]]\z/.match?(filter.phrase) ? '\b' : ''
 
         /(?mix:#{sb}#{Regexp.escape(filter.phrase)}#{eb})/
       else
@@ -475,7 +475,7 @@ class FeedManager
       status.media_attachments.map(&:description).join("\n\n"),
     ].compact.join("\n\n")
 
-    !combined_regex.match(combined_text).nil?
+    combined_regex.match?(combined_text)
   end
 
   # Adds a status to an account's feed, returning true if a status was