mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Remove censored_pattern site setting, which is replaced by watched words
This commit is contained in:
@@ -233,17 +233,7 @@ module PrettyText
|
||||
|
||||
working_text = text.dup
|
||||
|
||||
begin
|
||||
sanitized = markdown(working_text, options)
|
||||
rescue MiniRacer::ScriptTerminatedError => e
|
||||
if SiteSetting.censored_pattern.present?
|
||||
Rails.logger.warn "Post cooking timed out. Clearing the censored_pattern setting and retrying."
|
||||
SiteSetting.censored_pattern = nil
|
||||
sanitized = markdown(working_text, options)
|
||||
else
|
||||
raise e
|
||||
end
|
||||
end
|
||||
sanitized = markdown(working_text, options)
|
||||
|
||||
doc = Nokogiri::HTML.fragment(sanitized)
|
||||
|
||||
|
||||
@@ -5,11 +5,6 @@ class CensoredWordsValidator < ActiveModel::EachValidator
|
||||
attribute, :contains_censored_words,
|
||||
censored_words: join_censored_words(censored_words)
|
||||
)
|
||||
elsif SiteSetting.censored_pattern.present? && (censored_words = censor_words(value, /#{SiteSetting.censored_pattern}/i)).present?
|
||||
record.errors.add(
|
||||
attribute, :matches_censored_pattern,
|
||||
censored_words: join_censored_words(censored_words)
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user