Revision 8c81cad5
src/etc/inc/unbound.inc | ||
---|---|---|
255 | 255 |
$tlsport = is_port($unboundcfg['tlsport']) ? $unboundcfg['tlsport'] : "853"; |
256 | 256 |
$bindintcfg = ""; |
257 | 257 |
$bindints = array(); |
258 |
$active_interfaces = explode(",", $unboundcfg['active_interface']);
|
|
258 |
$active_interfaces = array_filter(explode(",", $unboundcfg['active_interface']));
|
|
259 | 259 |
if (empty($unboundcfg['active_interface']) || in_array("all", $active_interfaces, true)) { |
260 | 260 |
$bindintcfg .= "interface-automatic: yes" . PHP_EOL; |
261 | 261 |
if (isset($unboundcfg['enablessl'])) { |
... | ... | |
1060 | 1060 |
function unbound_auto_ednsbufsize() { |
1061 | 1061 |
$active_ipv6_inf = false; |
1062 | 1062 |
if (config_get_path('unbound/active_interface') != 'all') { |
1063 |
$active_interfaces = explode(",", config_get_path('unbound/active_interface'));
|
|
1063 |
$active_interfaces = array_filter(explode(",", config_get_path('unbound/active_interface')));
|
|
1064 | 1064 |
} else { |
1065 | 1065 |
$active_interfaces = get_configured_interface_list(); |
1066 | 1066 |
} |
Also available in: Unified diff
Filter out empty array values for explode()
Calling explode() with an empty string will return a single-element
array with an empty value. This change filters out empty values
where appropriate - i.e. where it's not already a condition check for
it and the value should not be empty.