diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2015-03-14 15:02:23 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2015-03-14 15:02:23 +0000 |
commit | bcd35e4c44ac660f020ce255cca29667e658e7b5 (patch) | |
tree | 64d5d17e1ae3d7de202130aea831ba73afac7676 /app/models | |
parent | 64d5ba05d87754f79662bbc0fb727f075f5126f5 (diff) | |
download | redmine-bcd35e4c44ac660f020ce255cca29667e658e7b5.tar.gz redmine-bcd35e4c44ac660f020ce255cca29667e658e7b5.zip |
Merged r14081 (#19323).
git-svn-id: http://svn.redmine.org/redmine/branches/3.0-stable@14093 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/mailer.rb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/app/models/mailer.rb b/app/models/mailer.rb index 31ae03b8a..9953ea509 100644 --- a/app/models/mailer.rb +++ b/app/models/mailer.rb @@ -24,7 +24,16 @@ class Mailer < ActionMailer::Base include Redmine::I18n def self.default_url_options - { :host => Setting.host_name, :protocol => Setting.protocol } + options = {:protocol => Setting.protocol} + if Setting.host_name.to_s =~ /\A(https?\:\/\/)?(.+?)(\:(\d+))?(\/.+)?\z/i + host, port, prefix = $2, $4, $5 + options.merge!({ + :host => host, :port => port, :script_name => prefix + }) + else + options[:host] = Setting.host_name + end + options end # Builds a mail for notifying to_users and cc_users about a new issue |