From bcd35e4c44ac660f020ce255cca29667e658e7b5 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sat, 14 Mar 2015 15:02:23 +0000 Subject: Merged r14081 (#19323). git-svn-id: http://svn.redmine.org/redmine/branches/3.0-stable@14093 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/mailer.rb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'app/models') 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 -- cgit v1.2.3