diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2013-03-19 08:21:46 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2013-03-19 08:21:46 +0000 |
commit | cfec2018e3d2ea4eb0597770a39a0ff29cc5839d (patch) | |
tree | ec0b572dcc3f12f65ffbe44b447e7cf983481c7e | |
parent | 008342082970e6d8b3b985c760a3a256c19c1d28 (diff) | |
download | redmine-cfec2018e3d2ea4eb0597770a39a0ff29cc5839d.tar.gz redmine-cfec2018e3d2ea4eb0597770a39a0ff29cc5839d.zip |
Merged r11648, r11649, r11650 from trunk to 2.3-stable.
upgrade Rails 3.2.13.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11652 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r-- | Gemfile | 4 | ||||
-rw-r--r-- | app/models/mail_handler.rb | 32 |
2 files changed, 3 insertions, 33 deletions
@@ -1,6 +1,6 @@ source 'https://rubygems.org' -gem 'rails', '3.2.12' +gem "rails", "3.2.13" gem "jquery-rails", "~> 2.0.2" gem "i18n", "~> 0.6.0" gem "coderay", "~> 1.0.6" @@ -78,7 +78,7 @@ end group :test do gem "shoulda", "~> 3.3.2" - gem "mocha" + gem "mocha", "~> 0.13.3" gem 'capybara', '~> 2.0.0' end diff --git a/app/models/mail_handler.rb b/app/models/mail_handler.rb index 6581c8f28..8421fb67d 100644 --- a/app/models/mail_handler.rb +++ b/app/models/mail_handler.rb @@ -254,26 +254,9 @@ class MailHandler < ActionMailer::Base def add_attachments(obj) if email.attachments && email.attachments.any? email.attachments.each do |attachment| - filename = attachment.filename - unless filename.respond_to?(:encoding) - # try to reencode to utf8 manually with ruby1.8 - h = attachment.header['Content-Disposition'] - unless h.nil? - begin - if m = h.value.match(/filename\*[0-9\*]*=([^=']+)'/) - filename = Redmine::CodesetUtil.to_utf8(filename, m[1]) - elsif m = h.value.match(/filename=.*=\?([^\?]+)\?[BbQq]\?/) - # http://tools.ietf.org/html/rfc2047#section-4 - filename = Redmine::CodesetUtil.to_utf8(filename, m[1]) - end - rescue - # nop - end - end - end obj.attachments << Attachment.create(:container => obj, :file => attachment.decoded, - :filename => filename, + :filename => attachment.filename, :author => user, :content_type => attachment.mime_type) end @@ -396,19 +379,6 @@ class MailHandler < ActionMailer::Base def cleaned_up_subject subject = email.subject.to_s - unless subject.respond_to?(:encoding) - # try to reencode to utf8 manually with ruby1.8 - begin - if h = email.header[:subject] - # http://tools.ietf.org/html/rfc2047#section-4 - if m = h.value.match(/=\?([^\?]+)\?[BbQq]\?/) - subject = Redmine::CodesetUtil.to_utf8(subject, m[1]) - end - end - rescue - # nop - end - end subject.strip[0,255] end |