mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Prefer \A and \z over ^ and $ in regexes (#19936)
This commit is contained in:
committed by
GitHub
parent
f7907a3645
commit
666536cbd1
@@ -50,7 +50,7 @@ module ApplicationHelper
|
||||
|
||||
def google_universal_analytics_json(ua_domain_name = nil)
|
||||
result = {}
|
||||
result[:cookieDomain] = ua_domain_name.gsub(%r{^http(s)?://}, "") if ua_domain_name
|
||||
result[:cookieDomain] = ua_domain_name.gsub(%r{\Ahttp(s)?://}, "") if ua_domain_name
|
||||
result[:userId] = current_user.id if current_user.present?
|
||||
result[:allowLinker] = true if SiteSetting.ga_universal_auto_link_domains.present?
|
||||
result.to_json
|
||||
@@ -117,9 +117,9 @@ module ApplicationHelper
|
||||
# seconds.
|
||||
if !script.start_with?("discourse/tests/")
|
||||
if is_brotli_req?
|
||||
path = path.gsub(/\.([^.]+)$/, '.br.\1')
|
||||
path = path.gsub(/\.([^.]+)\z/, '.br.\1')
|
||||
elsif is_gzip_req?
|
||||
path = path.gsub(/\.([^.]+)$/, '.gz.\1')
|
||||
path = path.gsub(/\.([^.]+)\z/, '.gz.\1')
|
||||
end
|
||||
end
|
||||
elsif GlobalSetting.cdn_url&.start_with?("https") && is_brotli_req? &&
|
||||
|
||||
Reference in New Issue
Block a user