mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: strip invalid byte sequences
This commit is contained in:
@@ -27,6 +27,8 @@ class TextCleaner
|
||||
end
|
||||
|
||||
def self.clean(text, opts = {})
|
||||
# Remove invalid byte sequences
|
||||
text.scrub!("")
|
||||
# Replace !!!!! with a single !
|
||||
text.gsub!(/!+/, '!') if opts[:deduplicate_exclamation_marks]
|
||||
# Replace ????? with a single ?
|
||||
|
||||
Reference in New Issue
Block a user