lowercase domainnames when adding new (sub)domain to avoid issues with certificates on filesystem
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
@@ -354,7 +354,8 @@ class Domains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn
|
||||
}
|
||||
|
||||
// validation
|
||||
if ($p_domain == Settings::Get('system.hostname')) {
|
||||
$p_domain = strtolower($p_domain);
|
||||
if ($p_domain == strtolower(Settings::Get('system.hostname'))) {
|
||||
\Froxlor\UI\Response::standard_error('admin_domain_emailsystemhostname', '', true);
|
||||
}
|
||||
|
||||
|
||||
@@ -99,6 +99,7 @@ class SubDomains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
|
||||
$customer = $this->getCustomerData('subdomains');
|
||||
|
||||
// validation
|
||||
$subdomain = strtolower($subdomain);
|
||||
if (substr($subdomain, 0, 4) == 'xn--') {
|
||||
\Froxlor\UI\Response::standard_error('domain_nopunycode', '', true);
|
||||
}
|
||||
@@ -118,7 +119,7 @@ class SubDomains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
|
||||
'mydomain'
|
||||
), '', true);
|
||||
}
|
||||
if ($completedomain == Settings::Get('system.hostname')) {
|
||||
if ($completedomain == strtolower(Settings::Get('system.hostname'))) {
|
||||
\Froxlor\UI\Response::standard_error('admin_domain_emailsystemhostname', '', true);
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ class DomainsTest extends TestCase
|
||||
))->get();
|
||||
$customer_userdata = json_decode($json_result, true)['data'];
|
||||
$data = [
|
||||
'domain' => 'test.local',
|
||||
'domain' => 'TEST.local',
|
||||
'customerid' => $customer_userdata['customerid'],
|
||||
'override_tls' => 1,
|
||||
'ssl_protocols' => array(
|
||||
|
||||
@@ -28,7 +28,7 @@ class SubDomainsTest extends TestCase
|
||||
$customer_userdata = json_decode($json_result, true)['data'];
|
||||
|
||||
$data = [
|
||||
'subdomain' => 'mysub',
|
||||
'subdomain' => 'mySub',
|
||||
'domain' => 'test2.local'
|
||||
];
|
||||
$json_result = SubDomains::getLocal($customer_userdata, $data)->add();
|
||||
@@ -47,7 +47,7 @@ class SubDomainsTest extends TestCase
|
||||
$reseller_userdata['adminsession'] = 1;
|
||||
|
||||
$data = [
|
||||
'subdomain' => 'mysub2',
|
||||
'subdomain' => 'mySub2',
|
||||
'domain' => 'test2.local',
|
||||
'customerid' => 1
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user