mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -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
|
nil
|
||||||
else
|
else
|
||||||
regexp = '(' + words.map { |w| word_to_regexp(w) }.join('|'.freeze) + ')'
|
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
|
||||||
end
|
end
|
||||||
s.present? ? Regexp.new(s, Regexp::IGNORECASE) : nil
|
s.present? ? Regexp.new(s, Regexp::IGNORECASE) : nil
|
||||||
|
Loading…
Reference in New Issue
Block a user