mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-07 18:44:28 -04:00
Don't apply subdomain rules to self host
This commit is contained in:
parent
363460f513
commit
25a95e8e25
@ -915,27 +915,29 @@ class AccountController extends BaseController
|
|||||||
|
|
||||||
if (Input::get('custom_link') == 'subdomain') {
|
if (Input::get('custom_link') == 'subdomain') {
|
||||||
$subdomain = preg_replace('/[^a-zA-Z0-9_\-\.]/', '', substr(strtolower(Input::get('subdomain')), 0, MAX_SUBDOMAIN_LENGTH));
|
$subdomain = preg_replace('/[^a-zA-Z0-9_\-\.]/', '', substr(strtolower(Input::get('subdomain')), 0, MAX_SUBDOMAIN_LENGTH));
|
||||||
$exclude = [
|
if (Utils::isNinja()) {
|
||||||
'www',
|
$exclude = [
|
||||||
'app',
|
'www',
|
||||||
'mail',
|
'app',
|
||||||
'admin',
|
'mail',
|
||||||
'blog',
|
'admin',
|
||||||
'user',
|
'blog',
|
||||||
'contact',
|
'user',
|
||||||
'payment',
|
'contact',
|
||||||
'payments',
|
'payment',
|
||||||
'billing',
|
'payments',
|
||||||
'invoice',
|
'billing',
|
||||||
'business',
|
'invoice',
|
||||||
'owner',
|
'business',
|
||||||
'info',
|
'owner',
|
||||||
'ninja',
|
'info',
|
||||||
'docs',
|
'ninja',
|
||||||
'doc',
|
'docs',
|
||||||
'documents'
|
'doc',
|
||||||
];
|
'documents'
|
||||||
$rules['subdomain'] = "unique:accounts,subdomain,{$user->account_id},id|not_in:" . implode(',', $exclude);
|
];
|
||||||
|
$rules['subdomain'] = "unique:accounts,subdomain,{$user->account_id},id|not_in:" . implode(',', $exclude);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$iframeURL = preg_replace('/[^a-zA-Z0-9_\-\:\/\.]/', '', substr(strtolower(Input::get('iframe_url')), 0, MAX_IFRAME_URL_LENGTH));
|
$iframeURL = preg_replace('/[^a-zA-Z0-9_\-\:\/\.]/', '', substr(strtolower(Input::get('iframe_url')), 0, MAX_IFRAME_URL_LENGTH));
|
||||||
$iframeURL = rtrim($iframeURL, '/');
|
$iframeURL = rtrim($iframeURL, '/');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user