Don't apply subdomain rules to self host

This commit is contained in:
Hillel Coren 2016-12-05 21:54:10 +02:00
parent 363460f513
commit 25a95e8e25

View File

@ -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, '/');