Fix quoted-printable subject question-mark not being encoded

Fix #396
This commit is contained in:
Abdullah Samman 2018-12-05 17:11:09 +02:00 committed by Peter Bhat Harkins
parent 0e198cb9bf
commit 8f46f991f3
2 changed files with 10 additions and 1 deletions

View File

@ -12,7 +12,9 @@ class String
s = [self].pack("M")
if encoded_word
s.split(/\r?\n/).map {|l| "=?UTF-8?Q?" + l.gsub(/=*$/, "").tr(" ", "_") << "?=" }.join("\n\t")
s.split(/\r?\n/).map {|l|
"=?UTF-8?Q?" + l.gsub(/=*$/, "").gsub('?', '=3F').tr(" ", "_") << "?="
}.join("\n\t")
else
s
end

View File

@ -0,0 +1,7 @@
require_relative '../../script/mail_new_activity'
describe 'EmailSender' do
it "encodes text as quoted printable" do
expect("Why Use Pointers?".quoted_printable(true)).to eq("=?UTF-8?Q?Why_Use_Pointers=3F?=")
end
end