diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2019-06-10 11:40:48 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2019-06-10 11:40:48 +0000 |
commit | 7a66b3b1da98a0d898d1ca37e10b79a780f3381c (patch) | |
tree | 750b8ffb046080c65604f443a3cc9a918eb84dc7 /config/initializers | |
parent | 2a0dd8372f6b8a314fb7d30fbfbde62636023d92 (diff) | |
download | redmine-7a66b3b1da98a0d898d1ca37e10b79a780f3381c.tar.gz redmine-7a66b3b1da98a0d898d1ca37e10b79a780f3381c.zip |
Issue subject may be broken if the subject field is split into multiple lines (#31365).
Patch by Yuichi HARADA.
git-svn-id: http://svn.redmine.org/redmine/trunk@18245 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'config/initializers')
-rw-r--r-- | config/initializers/10-patches.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/config/initializers/10-patches.rb b/config/initializers/10-patches.rb index e0559903b..06edc943a 100644 --- a/config/initializers/10-patches.rb +++ b/config/initializers/10-patches.rb @@ -107,6 +107,20 @@ end require 'mail' +module Mail + class SubjectField + # Fixed that the issue subject may be broken if the subject field in the + # receiving email is split into multiple lines + def initialize(value = nil, charset = 'utf-8') + if mime_encode = /^(=\?\S+\?\S\?)/.match(value).to_a[1] + value.gsub!(/\?=\s+#{Regexp.escape(mime_encode)}/, '') + end + self.charset = charset + super(CAPITALIZED_FIELD, value, charset) + end + end +end + module DeliveryMethods class TmpFile def initialize(*args); end |