mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 08:57:10 -06:00
FIX: Missing word boundaries when non-regexp
This commit is contained in:
parent
d755c9c90f
commit
3785429948
@ -19,7 +19,7 @@ class WordWatcher
|
||||
nil
|
||||
else
|
||||
regexp = '(' + words.map { |w| word_to_regexp(w) }.join('|'.freeze) + ')'
|
||||
SiteSetting.watched_words_regular_expressions? ? regexp : "(#{regexp})"
|
||||
SiteSetting.watched_words_regular_expressions? ? regexp : "\\b(#{regexp})\\b"
|
||||
end
|
||||
end
|
||||
s.present? ? Regexp.new(s, Regexp::IGNORECASE) : nil
|
||||
|
Loading…
Reference in New Issue
Block a user