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
No related merge requests found
......@@ -76,7 +76,7 @@ $form["tabs"]['firewall'] = array (
'datatype' => 'VARCHAR',
'formtype' => 'TEXT',
'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'),
),
'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 (
'datatype' => 'VARCHAR',
'formtype' => 'TEXT',
'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'),
),
'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