Commit 45ec2cba authored by Franco Fichtner's avatar Franco Fichtner

interfaces: fix crash report

(cherry picked from commit de2b543d)
parent a976ac5b
...@@ -186,20 +186,20 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { ...@@ -186,20 +186,20 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
unset($config['interfaces'][$id]); /* delete the specified OPTn or LAN*/ unset($config['interfaces'][$id]); /* delete the specified OPTn or LAN*/
if (is_array($config['dhcpd']) && is_array($config['dhcpd'][$id])) { if (isset($config['dhcpd'][$id])) {
unset($config['dhcpd'][$id]); unset($config['dhcpd'][$id]);
services_dhcpd_configure(); services_dhcpd_configure();
} }
if (count($config['filter']['rule']) > 0) { if (isset($config['filter']['rule'])) {
foreach ($config['filter']['rule'] as $x => $rule) { foreach ($config['filter']['rule'] as $x => $rule) {
if($rule['interface'] == $id) { if ($rule['interface'] == $id) {
unset($config['filter']['rule'][$x]); unset($config['filter']['rule'][$x]);
} }
} }
} }
if (is_array($config['nat']['rule']) && count($config['nat']['rule']) > 0) { if (isset($config['nat']['rule'])) {
foreach ($config['nat']['rule'] as $x => $rule) { foreach ($config['nat']['rule'] as $x => $rule) {
if($rule['interface'] == $id) { if ($rule['interface'] == $id) {
unset($config['nat']['rule'][$x]['interface']); unset($config['nat']['rule'][$x]['interface']);
} }
} }
......
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