Commit e24916f0 authored by Franco Fichtner's avatar Franco Fichtner

src: fix a few warings from recent crash reports

parent 052f5c10
...@@ -3117,7 +3117,7 @@ EOD; ...@@ -3117,7 +3117,7 @@ EOD;
* interface in question to avoid problems with complicated routing * interface in question to avoid problems with complicated routing
* topologies * topologies
*/ */
if(isset($config['filter']['bypassstaticroutes']) && is_array($config['staticroutes']['route']) && count($config['staticroutes']['route'])) { if(isset($config['filter']['bypassstaticroutes']) && isset($config['staticroutes']['route']) && count($config['staticroutes']['route'])) {
$ipfrules .= "# Add rules to bypass firewall rules for static routes\n"; $ipfrules .= "# Add rules to bypass firewall rules for static routes\n";
foreach (get_staticroutes() as $route) { foreach (get_staticroutes() as $route) {
$friendly = $GatewaysList[$route['gateway']]['friendlyiface']; $friendly = $GatewaysList[$route['gateway']]['friendlyiface'];
......
...@@ -1669,7 +1669,7 @@ default: ...@@ -1669,7 +1669,7 @@ default:
EOD; EOD;
$setdefaultgw = false; $setdefaultgw = false;
$founddefaultgw = false; $founddefaultgw = false;
if (is_array($config['gateways']['gateway_item'])) { if (isset($config['gateways']['gateway_item'])) {
foreach($config['gateways']['gateway_item'] as $gateway) { foreach($config['gateways']['gateway_item'] as $gateway) {
if($interface == $gateway['interface'] && isset($gateway['defaultgw'])) { if($interface == $gateway['interface'] && isset($gateway['defaultgw'])) {
$setdefaultgw = true; $setdefaultgw = true;
......
...@@ -785,7 +785,7 @@ EOD; ...@@ -785,7 +785,7 @@ EOD;
// Handle option, number rowhelper values // Handle option, number rowhelper values
$dhcpdconf .= "\n"; $dhcpdconf .= "\n";
if($dhcpifconf['numberoptions']['item']) { if (isset($dhcpifconf['numberoptions']['item'])) {
foreach($dhcpifconf['numberoptions']['item'] as $itemidx => $item) { foreach($dhcpifconf['numberoptions']['item'] as $itemidx => $item) {
if(empty($item['type']) || $item['type'] == "text") if(empty($item['type']) || $item['type'] == "text")
$dhcpdconf .= " option custom-{$dhcpif}-{$itemidx} \"{$item['value']}\";\n"; $dhcpdconf .= " option custom-{$dhcpif}-{$itemidx} \"{$item['value']}\";\n";
......
...@@ -399,7 +399,7 @@ function show_advanced_dns() { ...@@ -399,7 +399,7 @@ function show_advanced_dns() {
</tr> </tr>
</table> </table>
</tr> </tr>
<?php if ($hostent['aliases']['item'] && is_array($hostent['aliases']['item'])): ?> <?php if (isset($hostent['aliases']['item'])): ?>
<?php foreach ($hostent['aliases']['item'] as $alias): ?> <?php foreach ($hostent['aliases']['item'] as $alias): ?>
<tr> <tr>
<td class="listlr" ondblclick="document.location='services_dnsmasq_edit.php?id=<?=$i;?>';"> <td class="listlr" ondblclick="document.location='services_dnsmasq_edit.php?id=<?=$i;?>';">
......
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