diff options
author | Jamis Buck <jamis@37signals.com> | 2005-06-30 21:40:43 +0000 |
---|---|---|
committer | Jamis Buck <jamis@37signals.com> | 2005-06-30 21:40:43 +0000 |
commit | 24a8cb1e5600d95a51323982e4d7508eb22c8b1f (patch) | |
tree | 130932096e9fbda51737d9e208e177112c289828 /actionmailer/lib/action_mailer/vendor | |
parent | 813a8b9d2a17e1f0d7f7dfdcf04a79c94722e283 (diff) | |
download | rails-24a8cb1e5600d95a51323982e4d7508eb22c8b1f.tar.gz rails-24a8cb1e5600d95a51323982e4d7508eb22c8b1f.tar.bz2 rails-24a8cb1e5600d95a51323982e4d7508eb22c8b1f.zip |
Normalize line endings in outgoing mail bodies to "\n" #1536 [John Long]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1576 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionmailer/lib/action_mailer/vendor')
-rwxr-xr-x | actionmailer/lib/action_mailer/vendor/tmail/mail.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/actionmailer/lib/action_mailer/vendor/tmail/mail.rb b/actionmailer/lib/action_mailer/vendor/tmail/mail.rb index 9111a65042..f4a42df19b 100755 --- a/actionmailer/lib/action_mailer/vendor/tmail/mail.rb +++ b/actionmailer/lib/action_mailer/vendor/tmail/mail.rb @@ -335,9 +335,13 @@ module TMail } end + def normalize_line_endings(text) + text.to_s.gsub(/\r\n?/, "\n") + end + def body=( str ) parse_body - @body_port.wopen {|f| f.write str } + @body_port.wopen {|f| f.write normalize_line_endings(str) } str end |