diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-11-08 13:25:45 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-11-08 13:25:45 +0000 |
commit | 077723c90a97e517b3726a0d9c66e36c0cd18d2f (patch) | |
tree | 03a9814a879b3d5aafedeac98fa6e12fc23655ef /app/models/mailer.rb | |
parent | 81eee10d5b000d4eb74dbe900a92e033a7ec56e9 (diff) | |
download | redmine-077723c90a97e517b3726a0d9c66e36c0cd18d2f.tar.gz redmine-077723c90a97e517b3726a0d9c66e36c0cd18d2f.zip |
Do not use @:skip_relative_url_root@ to generate urls in Mailer (#2122).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@1992 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/mailer.rb')
-rw-r--r-- | app/models/mailer.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/app/models/mailer.rb b/app/models/mailer.rb index 070f7e570..397807d16 100644 --- a/app/models/mailer.rb +++ b/app/models/mailer.rb @@ -183,9 +183,13 @@ class Mailer < ActionMailer::Base super set_language_if_valid Setting.default_language from Setting.mail_from - default_url_options[:host] = Setting.host_name + + # URL options + h = Setting.host_name + h = h.to_s.gsub(%r{\/.*$}, '') unless ActionController::AbstractRequest.relative_url_root.blank? + default_url_options[:host] = h default_url_options[:protocol] = Setting.protocol - default_url_options[:skip_relative_url_root] = true + # Common headers headers 'X-Mailer' => 'Redmine', 'X-Redmine-Host' => Setting.host_name, |