##// END OF EJS Templates
Merged r11648, r11649, r11650 from trunk to 2.2-stable....
Toshi MARUYAMA -
r11423:504a767028ec
parent child
Show More
@@ -1,6 +1,6
1 1 source 'http://rubygems.org'
2 2
3 gem 'rails', '3.2.12'
3 gem "rails", "3.2.13"
4 4 gem "jquery-rails", "~> 2.0.2"
5 5 gem "i18n", "~> 0.6.0"
6 6 gem "coderay", "~> 1.0.6"
@@ -79,7 +79,7 group :test do
79 79 platforms = [:mri_19]
80 80 platforms << :jruby if defined?(JRUBY_VERSION) && JRUBY_VERSION >= "1.7"
81 81 gem "test-unit", :platforms => platforms
82 gem "mocha", "0.12.3"
82 gem "mocha", "~> 0.13.3"
83 83 end
84 84
85 85 local_gemfile = File.join(File.dirname(__FILE__), "Gemfile.local")
@@ -249,26 +249,9 class MailHandler < ActionMailer::Base
249 249 def add_attachments(obj)
250 250 if email.attachments && email.attachments.any?
251 251 email.attachments.each do |attachment|
252 filename = attachment.filename
253 unless filename.respond_to?(:encoding)
254 # try to reencode to utf8 manually with ruby1.8
255 h = attachment.header['Content-Disposition']
256 unless h.nil?
257 begin
258 if m = h.value.match(/filename\*[0-9\*]*=([^=']+)'/)
259 filename = Redmine::CodesetUtil.to_utf8(filename, m[1])
260 elsif m = h.value.match(/filename=.*=\?([^\?]+)\?[BbQq]\?/)
261 # http://tools.ietf.org/html/rfc2047#section-4
262 filename = Redmine::CodesetUtil.to_utf8(filename, m[1])
263 end
264 rescue
265 # nop
266 end
267 end
268 end
269 252 obj.attachments << Attachment.create(:container => obj,
270 253 :file => attachment.decoded,
271 :filename => filename,
254 :filename => attachment.filename,
272 255 :author => user,
273 256 :content_type => attachment.mime_type)
274 257 end
@@ -391,19 +374,6 class MailHandler < ActionMailer::Base
391 374
392 375 def cleaned_up_subject
393 376 subject = email.subject.to_s
394 unless subject.respond_to?(:encoding)
395 # try to reencode to utf8 manually with ruby1.8
396 begin
397 if h = email.header[:subject]
398 # http://tools.ietf.org/html/rfc2047#section-4
399 if m = h.value.match(/=\?([^\?]+)\?[BbQq]\?/)
400 subject = Redmine::CodesetUtil.to_utf8(subject, m[1])
401 end
402 end
403 rescue
404 # nop
405 end
406 end
407 377 subject.strip[0,255]
408 378 end
409 379
General Comments 0
You need to be logged in to leave comments. Login now