Skip to content

Commit d4eae9f

Browse files
committed
Fixed: FS#875 - SRV Records need validation
1 parent 4855590 commit d4eae9f

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

interface/web/dns/form/dns_srv.tform.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,9 @@
9999
'formtype' => 'TEXT',
100100
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
101101
'errmsg'=> 'data_error_empty'),
102+
1 => array ( 'type' => 'REGEX',
103+
'regex' => '/^[\w\.\-]{0,64}\s[\w\.\-]{0,64}\s[\w\.\-]{0,64}$/',
104+
'errmsg'=> 'srv_error_regex'),
102105
),
103106
'default' => '',
104107
'value' => '',

interface/web/dns/lib/lang/en_dns_srv.lng

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ $wb["name_error_empty"] = 'The hostname is empty.';
1212
$wb["name_error_regex"] = 'The hostname has the wrong format.';
1313
$wb["data_error_empty"] = 'Server record empty';
1414
$wb["data_error_regex"] = 'Server record format invalid';
15+
$wb["srv_error_regex"] = 'Invalid server record format. The server record must contain 3 text strings separated by spaces.';
1516
?>

0 commit comments

Comments
 (0)