]> source.dussan.org Git - redmine.git/commitdiff
Merged r11648, r11649, r11650 from trunk to 2.2-stable.
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Tue, 19 Mar 2013 08:40:52 +0000 (08:40 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Tue, 19 Mar 2013 08:40:52 +0000 (08:40 +0000)
upgrade Rails 3.2.13.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.2-stable@11653 e93f8b46-1217-0410-a6f0-8f06a7374b81

Gemfile
app/models/mail_handler.rb

diff --git a/Gemfile b/Gemfile
index f46828660afba9a9f46f0bd934900224ab62c53a..4cec2e0a9d2fd5bc0f2f3961d616af15cd4bb843 100644 (file)
--- a/Gemfile
+++ b/Gemfile
@@ -1,6 +1,6 @@
 source 'http://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"
@@ -79,7 +79,7 @@ group :test do
   platforms = [:mri_19]
   platforms << :jruby if defined?(JRUBY_VERSION) && JRUBY_VERSION >= "1.7"
   gem "test-unit", :platforms => platforms
-  gem "mocha", "0.12.3"
+  gem "mocha", "~> 0.13.3"
 end
 
 local_gemfile = File.join(File.dirname(__FILE__), "Gemfile.local")
index b87fbeda452aa914fcd3209c7d62f658dad1b72d..dccf05d81c9d9da0e36dff1e39d4915aedcff721 100644 (file)
@@ -249,26 +249,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
@@ -391,19 +374,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