From 378d8326bfb5b5713caf74c370dd14fd547f9c21 Mon Sep 17 00:00:00 2001 From: Florian Schaal <florian@schaal-24.de> Date: Tue, 02 Dec 2014 02:27:06 -0500 Subject: [PATCH] disallow spf, dkim, and dmarc-records when editing / creating a TXT record --- interface/web/dns/form/dns_txt.tform.php | 31 +++++++++++++++++++------------ 1 files changed, 19 insertions(+), 12 deletions(-) diff --git a/interface/web/dns/form/dns_txt.tform.php b/interface/web/dns/form/dns_txt.tform.php index a4b7d40..6cfb345 100644 --- a/interface/web/dns/form/dns_txt.tform.php +++ b/interface/web/dns/form/dns_txt.tform.php @@ -105,24 +105,31 @@ 'data' => array ( 'datatype' => 'VARCHAR', 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', - 'errmsg'=> 'data_error_empty'), + 'validators' => array ( + 0 => array ( + 'type' => 'NOTEMPTY', + 'errmsg'=> 'data_error_empty' + ), + 1 => array ( + 'type' => 'REGEX', + 'regex' => "/^((?!v=DKIM).)*$/s", + 'errmsg'=> 'invalid_type_dkim' + ), + 2 => array ( + 'type' => 'REGEX', + 'regex' => "/^((?!v=DMARC).)*$/s", + 'errmsg'=> 'invalid_type_dmarc'), + 3 => array ( + 'type' => 'REGEX', + 'regex' => "/^((?!v=spf).)*$/s", + 'errmsg'=> 'invalid_type_spf' + ), ), 'default' => '', 'value' => '', 'width' => '30', 'maxlength' => '255' ), - /* - 'aux' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'default' => '0', - 'value' => '', - 'width' => '10', - 'maxlength' => '10' - ), - */ 'ttl' => array ( 'datatype' => 'INTEGER', 'formtype' => 'TEXT', -- Gitblit v1.9.1