diff options
author | jim-p <jimp@pfsense.org> | 2012-02-23 16:23:40 -0500 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2012-02-23 16:24:23 -0500 |
commit | d3a2337a7225c38655e20c918291adb95b7a3391 (patch) | |
tree | 45e2f5adde70e6e19100628101789a89b199db97 /etc/inc | |
parent | 0b84b20037281f431dca248700d2b74b0c29d0f5 (diff) | |
download | pfsense-d3a2337a7225c38655e20c918291adb95b7a3391.zip pfsense-d3a2337a7225c38655e20c918291adb95b7a3391.tar.gz |
While we're at it, allow hostnames for syslog servers, since that is also valid.
Diffstat (limited to 'etc/inc')
-rw-r--r-- | etc/inc/util.inc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/etc/inc/util.inc b/etc/inc/util.inc index 420ca0e..b370d69 100644 --- a/etc/inc/util.inc +++ b/etc/inc/util.inc @@ -497,6 +497,16 @@ function is_ipaddrwithport($ipport) { } } +function is_hostnamewithport($hostport) { + $parts = explode(":", $hostport); + $port = array_pop($parts); + if (count($parts) == 1) { + return is_hostname($parts[0]) && is_port($port); + } else { + return false; + } +} + /* returns true if $ipaddr is a valid dotted IPv4 address or an alias thereof */ function is_ipaddroralias($ipaddr) { global $config; |