Project

General

Profile

Patch #17718 » 0001-Allow-unicode-whitespace-after-mail-handler-body-del.patch

Holger Just, 2014-08-20 18:21

View differences:

app/models/mail_handler.rb
521 521
  def cleanup_body(body)
522 522
    delimiters = Setting.mail_handler_body_delimiters.to_s.split(/[\r\n]+/).reject(&:blank?).map {|s| Regexp.escape(s)}
523 523
    unless delimiters.empty?
524
      regex = Regexp.new("^[> ]*(#{ delimiters.join('|') })\s*[\r\n].*", Regexp::MULTILINE)
524
      blank = RUBY_VERSION < '1.9' ? "\\s" : "[[:blank:]]"
525
      regex = Regexp.new("^[> ]*(#{ delimiters.join('|') })#{blank}*[\r\n].*", Regexp::MULTILINE)
525 526
      body = body.gsub(regex, '')
526 527
    end
527 528
    body.strip
(1-1/3)