diff options
Diffstat (limited to 'src/etc')
-rw-r--r-- | src/etc/inc/filter.inc | 6 | ||||
-rw-r--r-- | src/etc/inc/pfsense-utils.inc | 2 | ||||
-rw-r--r-- | src/etc/inc/util.inc | 10 |
3 files changed, 9 insertions, 9 deletions
diff --git a/src/etc/inc/filter.inc b/src/etc/inc/filter.inc index 7f64540..d940442 100644 --- a/src/etc/inc/filter.inc +++ b/src/etc/inc/filter.inc @@ -636,7 +636,7 @@ function filter_generate_nested_alias_recurse($name, $alias, &$aliasnesting, &$a $tmpline = filter_generate_nested_alias_recurse($name, $aliastable[$address], $aliasnesting, $aliasaddrnesting, $use_filterdns); } } else if (!isset($aliasaddrnesting[$address])) { - if (!is_ipaddr($address) && !is_subnet($address) && !((($alias_type == 'port') || ($alias_type == 'url_ports')) && is_portorrange($address)) && is_hostname($address)) { + if (!is_ipaddr($address) && !is_subnet($address) && !((($alias_type == 'port') || ($alias_type == 'url_ports')) && is_port_or_range($address)) && is_hostname($address)) { if (!isset($filterdns["{$address}{$name}"])) { $use_filterdns = true; $filterdns["{$address}{$name}"] = "pf {$address} {$name}\n"; @@ -2710,7 +2710,7 @@ function filter_generate_user_rule($rule) { return "# {$error_text}"; } if ($rule['source']['port'] - && !is_portorrange(str_replace("-", ":", $rule['source']['port']))) { + && !is_port_or_range(str_replace("-", ":", $rule['source']['port']))) { $error_text = ""; // It is not a literal port or port range, so alias should exist, and expand to something non-empty @@ -2726,7 +2726,7 @@ function filter_generate_user_rule($rule) { } } if ($rule['destination']['port'] - && !is_portorrange(str_replace("-", ":", $rule['destination']['port']))) { + && !is_port_or_range(str_replace("-", ":", $rule['destination']['port']))) { $error_text = ""; // It is not a literal port or port range, so alias should exist, and expand to something non-empty diff --git a/src/etc/inc/pfsense-utils.inc b/src/etc/inc/pfsense-utils.inc index 83b2f5a..81a2ea3 100644 --- a/src/etc/inc/pfsense-utils.inc +++ b/src/etc/inc/pfsense-utils.inc @@ -2153,7 +2153,7 @@ function parse_aliases_file($filename, $type = "url", $max_items = -1, $kflc = f $tmp = $tmp_str; } $valid = (($type == "url" || $type == "urltable") && (is_ipaddr($tmp) || is_subnet($tmp))) || - (($type == "url_ports" || $type == "urltable_ports") && is_portorrange($tmp)); + (($type == "url_ports" || $type == "urltable_ports") && is_port_or_range($tmp)); if ($valid) { $items[] = $tmp; if (count($items) == $max_items) { diff --git a/src/etc/inc/util.inc b/src/etc/inc/util.inc index 76410b4..6eb288d 100644 --- a/src/etc/inc/util.inc +++ b/src/etc/inc/util.inc @@ -1125,12 +1125,12 @@ function is_portrange($portrange) { } /* returns true if $port is a valid TCP/UDP port number or range ("<port>:<port>") */ -function is_portorrange($port) { +function is_port_or_range($port) { return (is_port($port) || is_portrange($port)); } /* returns true if $port is a valid port number or an alias thereof */ -function is_portoralias($port) { +function is_port_or_alias($port) { global $config; if (is_alias($port)) { @@ -1148,8 +1148,8 @@ function is_portoralias($port) { } /* returns true if $port is a valid TCP/UDP port number or range ("<port>:<port>") or an alias thereof */ -function is_portorrangeoralias($port) { - return (is_portoralias($port) || is_portrange($port)); +function is_port_or_range_or_alias($port) { + return (is_port_or_alias($port) || is_portrange($port)); } /* create ranges of sequential port numbers (200:215) and remove duplicates */ @@ -1791,7 +1791,7 @@ function alias_expand($name) { } } return "\${$name}"; - } else if (is_ipaddr($name) || is_subnet($name) || is_portorrange($name)) { + } else if (is_ipaddr($name) || is_subnet($name) || is_port_or_range($name)) { return "{$name}"; } else { return null; |