Add Url and Domain validation for CAA records using native Froxlor function
This commit is contained in:
@@ -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];
|
||||
}
|
||||
|
||||
@@ -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' => '@',
|
||||
|
||||
Reference in New Issue
Block a user