mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 13:12:50 +01:00
Fixes for regex for subdomain name
This commit is contained in:
parent
2b6f0870b3
commit
46ae91f920
@ -49,7 +49,7 @@ class StoreCompanyRequest extends Request
|
||||
} else {
|
||||
|
||||
if(Ninja::isHosted()){
|
||||
$rules['subdomain'] = ['nullable', 'alpha_num', new ValidSubdomain($this->all())];
|
||||
$rules['subdomain'] = ['nullable', 'regex:/^[a-zA-Z0-9][a-zA-Z0-9.-]+[a-zA-Z0-9]$/', new ValidSubdomain($this->all())];
|
||||
}
|
||||
else
|
||||
$rules['subdomain'] = 'nullable|alpha_num';
|
||||
|
@ -50,7 +50,7 @@ class UpdateCompanyRequest extends Request
|
||||
} else {
|
||||
|
||||
if(Ninja::isHosted()){
|
||||
$rules['subdomain'] = ['nullable', 'alpha_num', new ValidSubdomain($this->all())];
|
||||
$rules['subdomain'] = ['nullable', 'regex:/^[a-zA-Z0-9][a-zA-Z0-9.-]+[a-zA-Z0-9]$/', new ValidSubdomain($this->all())];
|
||||
}
|
||||
else
|
||||
$rules['subdomain'] = 'nullable|alpha_num';
|
||||
|
Loading…
Reference in New Issue
Block a user