diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2005-07-12 04:10:42 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2005-07-12 04:10:42 +0000 |
commit | 3f0d26d9f9bbf8c6a30d5392a12e2d8dcec0564d (patch) | |
tree | 093a60f1e3e11b9c0f500589e0a71df60a95edc8 /usr/local/captiveportal | |
parent | 033ede9717bc6916ab8824ff82984b83a005f338 (diff) | |
download | pfsense-3f0d26d9f9bbf8c6a30d5392a12e2d8dcec0564d.zip pfsense-3f0d26d9f9bbf8c6a30d5392a12e2d8dcec0564d.tar.gz |
Do not loop through array if its empty
Diffstat (limited to 'usr/local/captiveportal')
-rwxr-xr-x | usr/local/captiveportal/index.php | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/usr/local/captiveportal/index.php b/usr/local/captiveportal/index.php index 321174e..72eaff8 100755 --- a/usr/local/captiveportal/index.php +++ b/usr/local/captiveportal/index.php @@ -63,11 +63,11 @@ if (!$clientmac && !isset($config['captiveportal']['nomacfilter'])) { /* loop through allowed ip list. if user is on the list then allow * them access w/o authenticating */ -$a_allowedips = &$config['captiveportal']['allowedip'] ; -foreach ($a_allowedips as $ip) { - if($clientip == $ip) - $allowed_ip = true; -} +if($config['captiveportal']['allowedip'] <> "") + foreach($config['captiveportal']['allowedip'] as $ip) { + if($clientip == $ip) + $allowed_ip = true; + } if ($clientmac && portal_mac_fixed($clientmac) or $allowed_ip == true) { /* punch hole in pf table and allow thru ip for the mac addresses */ |