diff options
author | bmeeks8 <bmeeks8@bellsouth.net> | 2013-06-01 17:48:46 -0400 |
---|---|---|
committer | bmeeks8 <bmeeks8@bellsouth.net> | 2013-06-01 17:48:46 -0400 |
commit | f6f9238c81a70f4a9f093b0695153bd92baeac78 (patch) | |
tree | 06c98d6ac6dba0fc9f78ee6f8eb932528f312685 | |
parent | 9202d4eee77550b77d0c4828e95fdd077dd35dc1 (diff) | |
download | pfsense-packages-f6f9238c81a70f4a9f093b0695153bd92baeac78.tar.gz pfsense-packages-f6f9238c81a70f4a9f093b0695153bd92baeac78.tar.bz2 pfsense-packages-f6f9238c81a70f4a9f093b0695153bd92baeac78.zip |
Add check to verify existence of array item before we use it.
-rwxr-xr-x | config/snort/snort_interfaces.php | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/config/snort/snort_interfaces.php b/config/snort/snort_interfaces.php index ad492df2..390b83eb 100755 --- a/config/snort/snort_interfaces.php +++ b/config/snort/snort_interfaces.php @@ -35,6 +35,7 @@ require_once("/usr/local/pkg/snort/snort.inc"); global $g, $rebuild_rules; $snortdir = SNORTDIR; +$rcdir = RCFILEPREFIX; $id = $_GET['id']; if (isset($_POST['id'])) @@ -60,11 +61,14 @@ if (isset($_POST['del_x'])) { // If interface had auto-generated Suppress List, then // delete that along with the interface $autolist = "{$a_nat[$rulei]['interface']}" . "suppress"; - $a_suppress = &$config['installedpackages']['snortglobal']['suppress']['item']; - foreach ($a_suppress as $k => $i) { - if ($i['name'] == $autolist) { - unset($config['installedpackages']['snortglobal']['suppress']['item'][$k]); - break; + if (is_array($config['installedpackages']['snortglobal']['suppress']) && + is_array($config['installedpackages']['snortglobal']['suppress']['item'])) { + $a_suppress = &$config['installedpackages']['snortglobal']['suppress']['item']; + foreach ($a_suppress as $k => $i) { + if ($i['name'] == $autolist) { + unset($config['installedpackages']['snortglobal']['suppress']['item'][$k]); + break; + } } } @@ -85,7 +89,7 @@ if (isset($_POST['del_x'])) { snort_create_rc(); else { conf_mount_rw(); - @unlink('/usr/local/etc/rc.d/snort.sh'); + @unlink("{$rcdir}/snort.sh"); conf_mount_ro(); } |