Commit 14b3fa5c authored by Franco Fichtner's avatar Franco Fichtner

src: fix a few `Illegal string offset' warnings

parent b0dac383
......@@ -445,7 +445,7 @@ function return_gateways_array($disabled = false, $localhost = false, $inactive
$i = -1;
/* Process/add all the configured gateways. */
if (is_array($config['gateways']['gateway_item'])) {
if (isset($config['gateways']['gateway_item'])) {
foreach ($config['gateways']['gateway_item'] as $gateway) {
/* Increment it here to do not skip items */
$i++;
......@@ -796,7 +796,7 @@ function return_gateway_groups_array() {
fixup_default_gateway("inet", $gateways_status, $gateways_arr);
fixup_default_gateway("inet6", $gateways_status, $gateways_arr);
}
if (is_array($config['gateways']['gateway_group'])) {
if (isset($config['gateways']['gateway_group'])) {
$carplist = get_configured_carp_interface_list();
foreach ($config['gateways']['gateway_group'] as $group) {
/* create array with group gateways members separated by tier */
......
......@@ -185,7 +185,7 @@ function interface_netgraph_needed($interface = "wan") {
}
if ($found == false) {
$realif = get_real_interface($interface);
if (is_array($config['ppps']['ppp']) && count($config['ppps']['ppp'])) {
if (isset($config['ppps']['ppp'])) {
foreach ($config['ppps']['ppp'] as $pppid => $ppp) {
/* This if block doesn't do anything. It can be deleted.
......
......@@ -387,7 +387,7 @@ function system_routing_configure($interface = '')
$interfacegwv6 = "";
$foundgwv6 = false;
/* tack on all the hard defined gateways as well */
if (is_array($config['gateways']['gateway_item'])) {
if (isset($config['gateways']['gateway_item'])) {
array_map('unlink', glob('/tmp/*_defaultgw{,v6}', GLOB_BRACE));
foreach ($config['gateways']['gateway_item'] as $gateway) {
if (isset($gateway['defaultgw'])) {
......
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