mirror of
https://github.com/discourse/discourse.git
synced 2025-09-04 08:47:37 +08:00
FIX: Missing word boundaries when non-regexp
This commit is contained in:
parent
d755c9c90f
commit
3785429948
1 changed files with 1 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue