Skip to content
Snippets Groups Projects
Commit 7db47a2f authored by Thom's avatar Thom :tools:
Browse files

Enhanced regex to disallow spaces, double comma', etc

parent ee5ce1f1
No related branches found
No related tags found
1 merge request!1192Don't allow spaces in firewall rule (#3443)
...@@ -76,7 +76,7 @@ $form["tabs"]['firewall'] = array ( ...@@ -76,7 +76,7 @@ $form["tabs"]['firewall'] = array (
'datatype' => 'VARCHAR', 'datatype' => 'VARCHAR',
'formtype' => 'TEXT', 'formtype' => 'TEXT',
'validators' => array ( 0 => array ( 'type' => 'REGEX', 'validators' => array ( 0 => array ( 'type' => 'REGEX',
'regex' => '/^[0-9\,\:]{0,255}$/', 'regex' => '/^\d{1,5}(?::\d{1,5})?(?:,\d{1,5}(?::\d{1,5})?)*$/',
'errmsg'=> 'tcp_ports_error_regex'), 'errmsg'=> 'tcp_ports_error_regex'),
), ),
'default' => '20,21,22,25,53,80,110,143,443,465,587,993,995,3306,8080,8081,10000', 'default' => '20,21,22,25,53,80,110,143,443,465,587,993,995,3306,8080,8081,10000',
...@@ -88,7 +88,7 @@ $form["tabs"]['firewall'] = array ( ...@@ -88,7 +88,7 @@ $form["tabs"]['firewall'] = array (
'datatype' => 'VARCHAR', 'datatype' => 'VARCHAR',
'formtype' => 'TEXT', 'formtype' => 'TEXT',
'validators' => array ( 0 => array ( 'type' => 'REGEX', 'validators' => array ( 0 => array ( 'type' => 'REGEX',
'regex' => '/^[0-9\,\:]{0,255}$/', 'regex' => '/^\d{1,5}(?::\d{1,5})?(?:,\d{1,5}(?::\d{1,5})?)*$/',
'errmsg'=> 'udp_ports_error_regex'), 'errmsg'=> 'udp_ports_error_regex'),
), ),
'default' => '53,3306', 'default' => '53,3306',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment