mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Merge subdomain fix
This commit is contained in:
parent
2417005b23
commit
c30547a331
@ -58,6 +58,11 @@ class DatabaseLookup
|
||||
} elseif ($guard == 'account') {
|
||||
if ($key = request()->account_key) {
|
||||
LookupAccount::setServerByField('account_key', $key);
|
||||
} else {
|
||||
$subdomain = Utils::getSubdomain(\Request::server('HTTP_HOST'));
|
||||
if ($subdomain != 'app') {
|
||||
LookupAccount::setServerByField('subdomain', $subdomain);
|
||||
}
|
||||
}
|
||||
} elseif ($guard == 'license') {
|
||||
config(['database.default' => DB_NINJA_1]);
|
||||
|
@ -1002,8 +1002,12 @@ class Utils
|
||||
$parts = parse_url($url);
|
||||
$subdomain = '';
|
||||
|
||||
if (isset($parts['host']) || isset($parts['path'])) {
|
||||
if (isset($parts['host'])) {
|
||||
$host = explode('.', $parts['host']);
|
||||
} else {
|
||||
$host = explode('.', $parts['path']);
|
||||
}
|
||||
if (count($host) > 2) {
|
||||
$subdomain = $host[0];
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user