2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-08-21 19:11:18 +08:00

fix onebox for your own site

This commit is contained in:
Sam Saffron 2013-02-06 16:22:11 +11:00
parent d237e3bf3b
commit 0f88947279
9 changed files with 58 additions and 12 deletions

View file

@ -21,8 +21,12 @@ module Discourse
def self.base_url
protocol = "http"
protocol = "https" if SiteSetting.use_ssl?
result = "#{protocol}://#{current_hostname}"
result << ":#{SiteSetting.port}" if SiteSetting.port.present?
if SiteSetting.force_hostname.present?
result = "#{protocol}://#{SiteSetting.force_hostname}"
else
result = "#{protocol}://#{current_hostname}"
end
result << ":#{SiteSetting.port}" if SiteSetting.port.present? && SiteSetting.port.to_i > 0
result
end