mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: allow blocking emojis (#7011)
https://meta.discourse.org/t/blocking-emojis-wont-work/105853
This commit is contained in:
@@ -19,7 +19,7 @@ class WordWatcher
|
||||
nil
|
||||
else
|
||||
regexp = '(' + words.map { |w| word_to_regexp(w) }.join('|'.freeze) + ')'
|
||||
SiteSetting.watched_words_regular_expressions? ? regexp : "\\b(#{regexp})\\b"
|
||||
SiteSetting.watched_words_regular_expressions? ? regexp : "(?<!\\w)(#{regexp})(?!\\w)"
|
||||
end
|
||||
end
|
||||
s.present? ? Regexp.new(s, Regexp::IGNORECASE) : nil
|
||||
|
||||
Reference in New Issue
Block a user