From 2b628028babce94e99d987a1831b623d843b98d8 Mon Sep 17 00:00:00 2001 From: Holger Just Date: Wed, 20 Aug 2014 18:15:25 +0200 Subject: [PATCH 1/2] Allow unicode whitespace after mail handler body delimiters --- app/models/mail_handler.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/mail_handler.rb b/app/models/mail_handler.rb index 69e70d2..bd4c584 100644 --- a/app/models/mail_handler.rb +++ b/app/models/mail_handler.rb @@ -521,7 +521,8 @@ class MailHandler < ActionMailer::Base 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 -- 2.0.0