mirror of
https://github.com/documize/community.git
synced 2025-07-24 07:39:43 +02:00
support for persona 5.7+ and prep'ed support for MariaDB 10.2+
This commit is contained in:
parent
f12cdfbd45
commit
e31c6e12a2
13 changed files with 768 additions and 682 deletions
|
@ -16,7 +16,17 @@ import (
|
|||
"strings"
|
||||
)
|
||||
|
||||
// find the subdomain (which is actually the organisation )
|
||||
// GetRequestSubdomain extracts subdomain from referring URL.
|
||||
func GetRequestSubdomain(r *http.Request) string {
|
||||
return urlSubdomain(r.Referer())
|
||||
}
|
||||
|
||||
// GetSubdomainFromHost extracts the subdomain from the requesting URL.
|
||||
func GetSubdomainFromHost(r *http.Request) string {
|
||||
return urlSubdomain(r.Host)
|
||||
}
|
||||
|
||||
// Find the subdomain (which is actually the organisation).
|
||||
func urlSubdomain(url string) string {
|
||||
url = strings.ToLower(url)
|
||||
url = strings.Replace(url, "https://", "", 1)
|
||||
|
@ -32,13 +42,3 @@ func urlSubdomain(url string) string {
|
|||
|
||||
return CheckDomain(url)
|
||||
}
|
||||
|
||||
// GetRequestSubdomain extracts subdomain from referring URL.
|
||||
func GetRequestSubdomain(r *http.Request) string {
|
||||
return urlSubdomain(r.Referer())
|
||||
}
|
||||
|
||||
// GetSubdomainFromHost extracts the subdomain from the requesting URL.
|
||||
func GetSubdomainFromHost(r *http.Request) string {
|
||||
return urlSubdomain(r.Host)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue