We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3c67774 commit c7b3909Copy full SHA for c7b3909
classes/local/utils.php
@@ -185,8 +185,11 @@ public static function get_ethernet_interface_name() {
185
$iter = new \RecursiveIteratorIterator($iter, \RecursiveIteratorIterator::CHILD_FIRST);
186
$iter = new \RegexIterator($iter, '|^.*/device$|i', \RecursiveRegexIterator::GET_MATCH);
187
$iter->setMaxDepth(2);
188
- $matches = array_values(preg_grep('#^.*/(eth|en).*$#i', array_keys(iterator_to_array($iter))))[0];
189
- return explode('/', $matches)[4];
+ if ( $matches = array_values(preg_grep('#^.*/(eth|en).*$#i', array_keys(iterator_to_array($iter)))) ) {
+ return explode('/', $matches[0])[4];
190
+ } else {
191
+ return false;
192
+ }
193
} else {
194
return false;
195
}
0 commit comments