Project

General

Profile

« Previous | Next » 

Revision 52ed3871

Added by Scott Ullrich almost 18 years ago

Only iterate an array if it is truly an array

Ticket #1463

View differences:

usr/local/www/diag_logs_ipsec.php
38 38
/* Create array with all IPSEC tunnel descriptions */
39 39
$search = array();
40 40
$replace = array();
41
foreach($config['ipsec']['tunnel'] as $tunnel) {
42
	$gateway = "{$tunnel['remote-gateway']}";
43
	$search[] = "/(racoon: )([A-Z:].*?)({$gateway}\[[0-9].+\]|{$gateway})(.*)/i";
44
	$replace[] = "$1<strong>[{$tunnel['descr']}]</strong>: $2$3$4";
45
}
41
if(is_array($config['ipsec']['tunnel']))
42
	foreach($config['ipsec']['tunnel'] as $tunnel) {
43
		$gateway = "{$tunnel['remote-gateway']}";
44
		$search[] = "/(racoon: )([A-Z:].*?)({$gateway}\[[0-9].+\]|{$gateway})(.*)/i";
45
		$replace[] = "$1<strong>[{$tunnel['descr']}]</strong>: $2$3$4";
46
	}
46 47
/* collect all our own ip addresses */
47 48
exec("/sbin/ifconfig|/usr/bin/awk '/inet / {print $2}'", $ip_address_list);
48 49
foreach($ip_address_list as $address) {

Also available in: Unified diff