caa.php 616 B

12345678910111213141516171819202122232425
  1. <?php declare(strict_types=1);
  2. $values = nsParseCommonRequirements();
  3. if (!($_POST['flag'] >= 0 AND $_POST['flag'] <= 255))
  4. output(403, 'Wrong value for <code>flag</code>.');
  5. if (!(preg_match('/^[a-z0-9]{1,127}$/D', $_POST['tag'])))
  6. output(403, 'Wrong value for <code>tag</code>.');
  7. if (!(preg_match('/^[a-zA-Z0-9 .,;*|#~@=:!?%$+\/\()[\]_-]{1,255}$/D', $_POST['value'])))
  8. output(403, 'Wrong value for <code>value</code>.');
  9. rateLimit();
  10. knotcZoneExec($_POST['zone'], [
  11. $values['domain'],
  12. $values['ttl'],
  13. 'CAA',
  14. $_POST['flag'],
  15. $_POST['tag'],
  16. $_POST['value']
  17. ]);
  18. output(200, _('Modification done.'));