Add Url and Domain validation for CAA records using native Froxlor function

This commit is contained in:
Marc-André Kolly
2019-07-29 15:02:13 +02:00
parent 3cba61a8d8
commit 84d80d695a
2 changed files with 5 additions and 1 deletions

View File

@@ -144,6 +144,10 @@ class DomainZones extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour
if (empty($matches)) {
$errors[] = $this->lng['error']['dns_content_invalid'];
} elseif (($matches['type'] == 'issue' || $matches['type'] == 'issuewild') && !\Froxlor\Validate\Validate::validateDomain($matches['domain'])) {
$errors[] = $this->lng['error']['dns_content_invalid'];
} elseif ($matches['type'] == 'iodef' && !\Froxlor\Validate\Validate::validateUrl($matches['url'])) {
$errors[] = $this->lng['error']['dns_content_invalid'];
} else {
$content = $matches[0];
}

View File

@@ -401,7 +401,7 @@ class DomainZonesTest extends TestCase
{
global $admin_userdata;
$content = '0 issue "letsencrypt.org"';
$content = '0 issuewild "letsencrypt.org"';
$data = [
'domainname' => 'test2.local',
'record' => '@',