mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
Only iterate an array if it is truly an array
This commit is contained in:
parent
b9782c394b
commit
52ed387189
@ -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) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user