From 3f0d26d9f9bbf8c6a30d5392a12e2d8dcec0564d Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Tue, 12 Jul 2005 04:10:42 +0000 Subject: Do not loop through array if its empty --- usr/local/captiveportal/index.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'usr/local') 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 */ -- cgit v1.1