From 8ea3fd0569ac2b1681de5ba3fbc2a2cc20981ad6 Mon Sep 17 00:00:00 2001 From: PiBa-NL Date: Fri, 2 Sep 2016 00:59:52 +0200 Subject: [PATCH] Input boxes with setPattern validation should not contain escape characters as they are already properly considered 'lists of characters' even when not escaped. --- src/usr/local/www/firewall_nat_1to1_edit.php | 4 ++-- src/usr/local/www/firewall_nat_out_edit.php | 4 ++-- src/usr/local/www/firewall_rules_edit.php | 2 +- src/usr/local/www/services_igmpproxy_edit.php | 2 +- src/usr/local/www/services_router_advertisements.php | 2 +- src/usr/local/www/services_unbound_domainoverride_edit.php | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/usr/local/www/firewall_nat_1to1_edit.php b/src/usr/local/www/firewall_nat_1to1_edit.php index 7efb07e3c81..7fd19f406bf 100644 --- a/src/usr/local/www/firewall_nat_1to1_edit.php +++ b/src/usr/local/www/firewall_nat_1to1_edit.php @@ -439,7 +439,7 @@ function dsttype_selected() { 'src', null, is_specialnet($pconfig['src']) ? '': $pconfig['src'] -))->addMask('srcmask', $pconfig['srcmask'], 31)->setHelp('Address/mask')->setPattern('[a-zA-Z0-9\.\:\_]+'); +))->addMask('srcmask', $pconfig['srcmask'], 31)->setHelp('Address/mask')->setPattern('[a-zA-Z0-9.:_]+'); $group->setHelp('Enter the internal (LAN) subnet for the 1:1 mapping. ' . 'The subnet size specified for the internal subnet will be applied to the external subnet.'); @@ -466,7 +466,7 @@ function dsttype_selected() { 'dst', null, is_specialnet($pconfig['dst']) ? '': $pconfig['dst'] -))->addMask('dstmask', $pconfig['dstmask'], 31)->setHelp('Address/mask')->setPattern('[a-zA-Z0-9\.\:\_]+'); +))->addMask('dstmask', $pconfig['dstmask'], 31)->setHelp('Address/mask')->setPattern('[a-zA-Z0-9.:_]+'); $group->setHelp('The 1:1 mapping will only be used for connections to or from the specified destination. Hint: this is usually "Any".'); diff --git a/src/usr/local/www/firewall_nat_out_edit.php b/src/usr/local/www/firewall_nat_out_edit.php index 0b4bbae83ca..6c845e54bbb 100644 --- a/src/usr/local/www/firewall_nat_out_edit.php +++ b/src/usr/local/www/firewall_nat_out_edit.php @@ -484,7 +484,7 @@ function build_target_list() { 'source', null, $pconfig['source'] -))->addMask('source_subnet', $pconfig['source_subnet'])->setHelp('Source network for the outbound NAT mapping.')->setPattern('[a-zA-Z0-9\_\.\:]+'); +))->addMask('source_subnet', $pconfig['source_subnet'])->setHelp('Source network for the outbound NAT mapping.')->setPattern('[a-zA-Z0-9_.:]+'); $group->add(new Form_Input( 'sourceport', @@ -508,7 +508,7 @@ function build_target_list() { 'destination', null, $pconfig['destination'] == "any" ? "":$pconfig['destination'] -))->addMask('destination_subnet', $pconfig['destination_subnet'])->setHelp('Destination network for the outbound NAT mapping.')->setPattern('[a-zA-Z0-9\_\.\:]+'); +))->addMask('destination_subnet', $pconfig['destination_subnet'])->setHelp('Destination network for the outbound NAT mapping.')->setPattern('[a-zA-Z0-9_.:]+'); $group->add(new Form_Input( 'dstport', diff --git a/src/usr/local/www/firewall_rules_edit.php b/src/usr/local/www/firewall_rules_edit.php index 84562df9d8b..43f2e5dfcf8 100644 --- a/src/usr/local/www/firewall_rules_edit.php +++ b/src/usr/local/www/firewall_rules_edit.php @@ -1323,7 +1323,7 @@ function build_if_list() { $type, $name .' Address', $pconfig[$type] - ))->addMask($type .'mask', $pconfig[$type.'mask'])->setPattern('[a-zA-Z0-9\_\.\:]+'); + ))->addMask($type .'mask', $pconfig[$type.'mask'])->setPattern('[a-zA-Z0-9_.:]+'); $section->add($group); diff --git a/src/usr/local/www/services_igmpproxy_edit.php b/src/usr/local/www/services_igmpproxy_edit.php index c862424837f..bc7625683b1 100644 --- a/src/usr/local/www/services_igmpproxy_edit.php +++ b/src/usr/local/www/services_igmpproxy_edit.php @@ -224,7 +224,7 @@ null, $address, ['placeholder' => 'Address'] - ))->sethelp($tracker == $rows ? 'Network/CIDR':null)->addMask('address_subnet' . $tracker, $address_subnet)->setWidth(4)->setPattern('[a-zA-Z0-9\_\.\:]+'); + ))->sethelp($tracker == $rows ? 'Network/CIDR':null)->addMask('address_subnet' . $tracker, $address_subnet)->setWidth(4)->setPattern('[a-zA-Z0-9_.:]+'); $group->add(new Form_Button( 'deleterow' . $counter, diff --git a/src/usr/local/www/services_router_advertisements.php b/src/usr/local/www/services_router_advertisements.php index e2df3e4f92c..bd47b131543 100644 --- a/src/usr/local/www/services_router_advertisements.php +++ b/src/usr/local/www/services_router_advertisements.php @@ -436,7 +436,7 @@ 'radns' . $idx, 'Server ' . $idx, $pconfig['radns' . $idx] - ))->setPattern('[a-zA-Z0-9\_\.\:]+')->setHelp(($idx < 3) ? '':'Leave blank to use the system default DNS servers - this interface\'s IP if DNS Forwarder or Resolver is enabled, otherwise the servers configured on the General page'); + ))->setPattern('[a-zA-Z0-9_.:]+')->setHelp(($idx < 3) ? '':'Leave blank to use the system default DNS servers - this interface\'s IP if DNS Forwarder or Resolver is enabled, otherwise the servers configured on the General page'); } $section->addInput(new Form_Input( diff --git a/src/usr/local/www/services_unbound_domainoverride_edit.php b/src/usr/local/www/services_unbound_domainoverride_edit.php index 55274d45292..ed3c631492e 100644 --- a/src/usr/local/www/services_unbound_domainoverride_edit.php +++ b/src/usr/local/www/services_unbound_domainoverride_edit.php @@ -133,7 +133,7 @@ function String_Begins_With($needle, $haystack) { 'IP Address', $pconfig['ip'] ))->setHelp('IP address of the authoritative DNS server for this domain. e.g.: 192.168.100.100' . '
' . - 'To use a non-default port for communication, append an \'@\' with the port number.')->setPattern('[a-zA-Z0-9\@\.\:]+'); + 'To use a non-default port for communication, append an \'@\' with the port number.')->setPattern('[a-zA-Z0-9@.:]+'); $section->addInput(new Form_Input( 'descr',