diff options
author | Ermal <eri@pfsense.org> | 2011-03-02 00:25:42 +0000 |
---|---|---|
committer | Ermal <eri@pfsense.org> | 2011-03-02 00:25:42 +0000 |
commit | 539d59730b31c9f00b6190b34f34af7ddf07c392 (patch) | |
tree | d2ea7853de9b24472e7cc9ae3f283283052ae556 /usr/local/pkg | |
parent | cf46a14f95aeecd7591e8f3db571a6f085a2a51c (diff) | |
download | pfsense-539d59730b31c9f00b6190b34f34af7ddf07c392.zip pfsense-539d59730b31c9f00b6190b34f34af7ddf07c392.tar.gz |
Remove custom code for checking ip_addr and use the pfsense provided one.
Diffstat (limited to 'usr/local/pkg')
-rw-r--r-- | usr/local/pkg/miniupnpd.inc | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/usr/local/pkg/miniupnpd.inc b/usr/local/pkg/miniupnpd.inc index cfa6267..f52214b 100644 --- a/usr/local/pkg/miniupnpd.inc +++ b/usr/local/pkg/miniupnpd.inc @@ -43,7 +43,8 @@ } function upnp_validate_ip($ip, $check_cdir) { - /* validate cdir */ + /* validate cidr */ + $ip_array = array(); if($check_cdir) { $ip_array = explode('/', $ip); if(count($ip_array) == 2) { @@ -56,11 +57,8 @@ $ip_array[] = $ip; /* validate ip */ - if(!eregi('^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$', $ip_array[0])) + if (!is_ipaddr($ip_array[0])) return false; - foreach(explode('.', $ip_array[0]) as $sub) - if($sub < 0 || $sub > 256) - return false; return true; } |