From c12bd9a3adb04b644dfbb79dee19c16b24af3f4a Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 27 Jul 2015 13:40:42 +0200 Subject: [PATCH] interfaces: get_interface_arr() should return an array but changing the default likely breaks something else so fix it here... --- src/etc/inc/interfaces.inc | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/etc/inc/interfaces.inc b/src/etc/inc/interfaces.inc index 79383d28e..8b7cec3a1 100644 --- a/src/etc/inc/interfaces.inc +++ b/src/etc/inc/interfaces.inc @@ -112,21 +112,24 @@ function get_interface_arr($flush = false) return $interface_arr_cache; } -/* - * does_interface_exist($interface): return true or false if a interface is - * detected. - */ -function does_interface_exist($interface, $flush = true) { +function does_interface_exist($interface, $flush = true) +{ global $config; - if(!$interface) + if(!$interface) { return false; + } $ints = get_interface_arr($flush); - if (in_array($interface, $ints)) - return true; - else + if ($ints == null) { return false; + } + + if (!in_array($interface, $ints)) { + return false; + } + + return true; }