mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
FIX: Make sure censored words are on boundaries in topic titles
This commit is contained in:
@ -33,7 +33,7 @@ class CensoredWordsValidator < ActiveModel::EachValidator
|
||||
|
||||
def censored_words_regexp
|
||||
Regexp.new(
|
||||
SiteSetting.censored_words.split('|'.freeze).map! { |w| Regexp.escape(w) }.join('|'.freeze),
|
||||
'\b(' + SiteSetting.censored_words.split('|'.freeze).map! { |w| Regexp.escape(w) }.join('|'.freeze) + ')\b',
|
||||
true
|
||||
)
|
||||
end
|
||||
|
Reference in New Issue
Block a user