mirror of
https://github.com/mastodon/mastodon
synced 2024-11-23 22:56:20 +09:00
Merge pull request from GHSA-v3xf-c9qf-j667
This commit is contained in:
parent
8e6fe19225
commit
9deb178126
@ -7,18 +7,18 @@ class TagManager
|
||||
include RoutingHelper
|
||||
|
||||
def web_domain?(domain)
|
||||
domain.nil? || domain.gsub(/[\/]/, '').casecmp(Rails.configuration.x.web_domain).zero?
|
||||
domain.nil? || domain.delete_suffix('/').casecmp(Rails.configuration.x.web_domain).zero?
|
||||
end
|
||||
|
||||
def local_domain?(domain)
|
||||
domain.nil? || domain.gsub(/[\/]/, '').casecmp(Rails.configuration.x.local_domain).zero?
|
||||
domain.nil? || domain.delete_suffix('/').casecmp(Rails.configuration.x.local_domain).zero?
|
||||
end
|
||||
|
||||
def normalize_domain(domain)
|
||||
return if domain.nil?
|
||||
|
||||
uri = Addressable::URI.new
|
||||
uri.host = domain.gsub(/[\/]/, '')
|
||||
uri.host = domain.delete_suffix('/')
|
||||
uri.normalized_host
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user