servnest/pg-act/ns/caa.php
2023-07-17 21:15:18 +02:00

25 lines
616 B
PHP

<?php declare(strict_types=1);
$values = nsParseCommonRequirements();
if (!($_POST['flag'] >= 0 AND $_POST['flag'] <= 255))
output(403, 'Wrong value for <code>flag</code>.');
if (!(preg_match('/^[a-z0-9]{1,127}$/D', $_POST['tag'])))
output(403, 'Wrong value for <code>tag</code>.');
if (!(preg_match('/^[a-zA-Z0-9 .,;*|#~@=:!?%$+\/\()[\]_-]{1,255}$/D', $_POST['value'])))
output(403, 'Wrong value for <code>value</code>.');
rateLimit();
knotcZoneExec($_POST['zone'], [
$values['domain'],
$values['ttl'],
'CAA',
$_POST['flag'],
$_POST['tag'],
$_POST['value']
]);
output(200, _('Modification done.'));