summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2007-10-01 22:00:28 +0000
committerScott Ullrich <sullrich@pfsense.org>2007-10-01 22:00:28 +0000
commit7fad5151328f0388170b6c1895036ce71114ab64 (patch)
treef6fc80a4db21e39469fa29b2927321c25fedec49
parent72ca7c7779d365bd264c35f989a5ee95e5f411a5 (diff)
downloadpfsense-7fad5151328f0388170b6c1895036ce71114ab64.zip
pfsense-7fad5151328f0388170b6c1895036ce71114ab64.tar.gz
Only iterate an array if it is truly an array Ticket #1463
-rwxr-xr-xusr/local/www/diag_logs_ipsec.php11
1 files changed, 6 insertions, 5 deletions
diff --git a/usr/local/www/diag_logs_ipsec.php b/usr/local/www/diag_logs_ipsec.php
index 271303d..7bb044f 100755
--- a/usr/local/www/diag_logs_ipsec.php
+++ b/usr/local/www/diag_logs_ipsec.php
@@ -38,11 +38,12 @@ $ipsec_logfile = "{$g['varlog_path']}/ipsec.log";
/* Create array with all IPSEC tunnel descriptions */
$search = array();
$replace = array();
-foreach($config['ipsec']['tunnel'] as $tunnel) {
- $gateway = "{$tunnel['remote-gateway']}";
- $search[] = "/(racoon: )([A-Z:].*?)({$gateway}\[[0-9].+\]|{$gateway})(.*)/i";
- $replace[] = "$1<strong>[{$tunnel['descr']}]</strong>: $2$3$4";
-}
+if(is_array($config['ipsec']['tunnel']))
+ foreach($config['ipsec']['tunnel'] as $tunnel) {
+ $gateway = "{$tunnel['remote-gateway']}";
+ $search[] = "/(racoon: )([A-Z:].*?)({$gateway}\[[0-9].+\]|{$gateway})(.*)/i";
+ $replace[] = "$1<strong>[{$tunnel['descr']}]</strong>: $2$3$4";
+ }
/* collect all our own ip addresses */
exec("/sbin/ifconfig|/usr/bin/awk '/inet / {print $2}'", $ip_address_list);
foreach($ip_address_list as $address) {
OpenPOWER on IntegriCloud