Skip to content

Commit

Permalink
Input boxes with setPattern validation should not contain escape char…
Browse files Browse the repository at this point in the history
…acters as they are already properly considered 'lists of characters' even when not escaped.
  • Loading branch information
PiBa-NL committed Sep 1, 2016
1 parent 8d50c07 commit 8ea3fd0
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/usr/local/www/firewall_nat_1to1_edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.');
Expand All @@ -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".');

Expand Down
4 changes: 2 additions & 2 deletions src/usr/local/www/firewall_nat_out_edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion src/usr/local/www/firewall_rules_edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion src/usr/local/www/services_igmpproxy_edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/usr/local/www/services_router_advertisements.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion src/usr/local/www/services_unbound_domainoverride_edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' . '<br />' .
'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',
Expand Down

0 comments on commit 8ea3fd0

Please sign in to comment.