Patch #17718 » 0001-Allow-unicode-whitespace-after-mail-handler-body-del.patch
| app/models/mail_handler.rb | ||
|---|---|---|
|
def cleanup_body(body)
|
||
|
delimiters = Setting.mail_handler_body_delimiters.to_s.split(/[\r\n]+/).reject(&:blank?).map {|s| Regexp.escape(s)}
|
||
|
unless delimiters.empty?
|
||
|
regex = Regexp.new("^[> ]*(#{ delimiters.join('|') })\s*[\r\n].*", Regexp::MULTILINE)
|
||
|
blank = RUBY_VERSION < '1.9' ? "\\s" : "[[:blank:]]"
|
||
|
regex = Regexp.new("^[> ]*(#{ delimiters.join('|') })#{blank}*[\r\n].*", Regexp::MULTILINE)
|
||
|
body = body.gsub(regex, '')
|
||
|
end
|
||
|
body.strip
|
||