Commit 9476f748 authored by Franco Fichtner's avatar Franco Fichtner

inc: the usual isset() splatter

parent 4df19f1b
......@@ -734,8 +734,8 @@ function filter_get_vpns_list() {
/* openvpn */
foreach (array('client', 'server') as $type) {
if(is_array($config['openvpn']["openvpn-$type"])) {
foreach ($config['openvpn']["openvpn-$type"] as $settings) {
if (isset($config['openvpn']['openvpn-' . $type])) {
foreach ($config['openvpn']['openvpn-' . $type] as $settings) {
if(is_array($settings)) {
if (!isset($settings['disable'])) {
$remote_networks = explode(',', $settings['remote_network']);
......@@ -1357,19 +1357,23 @@ function filter_nat_rules_automatic_tonathosts($with_descr = false) {
}
/* add openvpn interfaces */
if(is_array($config['openvpn']['openvpn-server']))
foreach ($config['openvpn']['openvpn-server'] as $ovpnsrv)
if (isset($config['openvpn']['openvpn-server'])) {
foreach ($config['openvpn']['openvpn-server'] as $ovpnsrv) {
if (!isset($ovpnsrv['disable']) && !empty($ovpnsrv['tunnel_network'])) {
$tonathosts[] = $ovpnsrv['tunnel_network'];
$descriptions[] = gettext("OpenVPN server");
}
}
}
if(is_array($config['openvpn']['openvpn-client']))
foreach ($config['openvpn']['openvpn-client'] as $ovpncli)
if (isset($config['openvpn']['openvpn-client'])) {
foreach ($config['openvpn']['openvpn-client'] as $ovpncli) {
if (!isset($ovpncli['disable']) && !empty($ovpncli['tunnel_network'])) {
$tonathosts[] = $ovpncli['tunnel_network'];
$descriptions[] = gettext("OpenVPN client");
}
}
}
/* IPsec mode_cfg subnet */
if (isset($config['ipsec']['client']['enable']) &&
......
......@@ -1225,13 +1225,19 @@ function interface_bring_down($interface = "wan", $destroy = false, $ifacecfg =
*/
if ($ifacecfg === false) {
$ifcfg = $config['interfaces'][$interface];
$ppps = array();
if (isset($config['ppps']['ppp'])) {
$ppps = $config['ppps']['ppp'];
}
$realif = get_real_interface($interface);
$realifv6 = get_real_interface($interface, "inet6", true);
} elseif (!is_array($ifacecfg)) {
log_error(gettext("Wrong parameters used during interface_bring_down"));
$ifcfg = $config['interfaces'][$interface];
$ppps = array();
if (isset($config['ppps']['ppp'])) {
$ppps = $config['ppps']['ppp'];
}
$realif = get_real_interface($interface);
$realifv6 = get_real_interface($interface, "inet6", true);
} else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment