mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
Refactor is_port_or functions
This commit is contained in:
parent
593e9fe32d
commit
fe108b671d
@ -1129,8 +1129,8 @@ 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_port_or_alias($port) {
|
||||
/* returns true if $port is an alias that is a port type */
|
||||
function is_portalias($port) {
|
||||
global $config;
|
||||
|
||||
if (is_alias($port)) {
|
||||
@ -1141,15 +1141,18 @@ function is_port_or_alias($port) {
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
} else {
|
||||
return is_port($port);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/* returns true if $port is a valid port number or an alias thereof */
|
||||
function is_port_or_alias($port) {
|
||||
return (is_port($port) || is_portalias($port));
|
||||
}
|
||||
|
||||
/* returns true if $port is a valid TCP/UDP port number or range ("<port>:<port>") or an alias thereof */
|
||||
function is_port_or_range_or_alias($port) {
|
||||
return (is_port_or_alias($port) || is_portrange($port));
|
||||
return (is_port($port) || is_portrange($port) || is_portalias($port));
|
||||
}
|
||||
|
||||
/* create ranges of sequential port numbers (200:215) and remove duplicates */
|
||||
|
||||
Loading…
Reference in New Issue
Block a user