Commit f927e8a3 authored by Ad Schellevis's avatar Ad Schellevis Committed by Franco Fichtner

(config/interfaces) some older configurations use <enabled/> in stead of our...

(config/interfaces) some older configurations use <enabled/> in stead of our current standard <enabled>1</enabled>. to avoid new issues, its better to convert when only set.

(cherry picked from commit c17a834f)
parent 6c5e6251
...@@ -59,7 +59,11 @@ function legacy_config_get_interfaces($filters = array()) ...@@ -59,7 +59,11 @@ function legacy_config_get_interfaces($filters = array())
// apply filters // apply filters
$iface_match = true; $iface_match = true;
foreach ($filters as $filter_key => $filter_value) { foreach ($filters as $filter_key => $filter_value) {
if ($filter_key == 'enable' && isset($iface[$filter_key])) {
$field_value = true;
} else {
$field_value = isset($iface[$filter_key]) ? $iface[$filter_key] : false; $field_value = isset($iface[$filter_key]) ? $iface[$filter_key] : false;
}
if ($field_value != $filter_value) { if ($field_value != $filter_value) {
$iface_match = false; $iface_match = false;
break; break;
......
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