Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Use the full template file name for implicitly selected templates, in…

…stead of requiring AV to try to detect it (which is broken for this use case) (closes #4297)

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3955 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
commit 797de4d057ff226e4e7d689da537472396bf6f86 1 parent fbd1e01
Jamis Buck jamis authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 actionmailer/lib/action_mailer/base.rb
5 actionmailer/lib/action_mailer/base.rb
View
@@ -283,8 +283,9 @@ def create!(method_name, *parameters) #:nodoc:
templates = Dir.glob("#{template_path}/#{@template}.*")
templates.each do |path|
# TODO: don't hardcode rhtml|rxml
- next unless md = /^([^\.]+)\.([^\.]+\.[^\+]+)\.(rhtml|rxml)$/.match(File.basename(path))
- template_name = "#{md.captures[0]}.#{md.captures[1]}"
+ basename = File.basename(path)
+ next unless md = /^([^\.]+)\.([^\.]+\.[^\+]+)\.(rhtml|rxml)$/.match(basename)
+ template_name = basename
content_type = md.captures[1].gsub('.', '/')
@parts << Part.new(:content_type => content_type,
:disposition => "inline", :charset => charset,
Please sign in to comment.
Something went wrong with that request. Please try again.