mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 16:41:17 +08:00
SECURITY: Make sure uploaded_urls have corresponding upload records
This commit is contained in:
@ -186,9 +186,13 @@ module Discourse
|
||||
ActionController::Base.config.relative_url_root.presence || default_value
|
||||
end
|
||||
|
||||
def self.base_protocol
|
||||
SiteSetting.force_https? ? "https" : "http"
|
||||
end
|
||||
|
||||
def self.base_url_no_prefix
|
||||
protocol, default_port = SiteSetting.force_https? ? ["https", 443] : ["http", 80]
|
||||
url = "#{protocol}://#{current_hostname}"
|
||||
default_port = SiteSetting.force_https? ? 443 : 80
|
||||
url = "#{base_protocol}://#{current_hostname}"
|
||||
url << ":#{SiteSetting.port}" if SiteSetting.port.to_i > 0 && SiteSetting.port.to_i != default_port
|
||||
url
|
||||
end
|
||||
|
Reference in New Issue
Block a user