Skip to content

Commit

Permalink
Merge pull request #1854 from desertwitch/fix-php-warning
Browse files Browse the repository at this point in the history
dynamix/include/SysDevs.php: fix PHP warnings
  • Loading branch information
limetech authored Sep 16, 2024
2 parents 72abe50 + 73705b7 commit 8120959
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions emhttp/plugins/dynamix/include/SysDevs.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,11 @@ function usb_physical_port($usbbusdev) {
foreach ($devicelist as $line) {
if (!empty($line)) {
exec('udevadm info --path=$(udevadm info -q path /dev/'.$line.' | cut -d / -f 1-7) --query=path',$linereturn);
preg_match_all($DBDF_PARTIAL_REGEX, $linereturn[0], $inuse);
foreach ($inuse[0] as $line) {
$lines[] = $line;
if(isset($linereturn[0])) {
preg_match_all($DBDF_PARTIAL_REGEX, $linereturn[0], $inuse);
foreach ($inuse[0] as $line) {
$lines[] = $line;
}
}
unset($inuse);
unset($linereturn);
Expand All @@ -92,9 +94,11 @@ function usb_physical_port($usbbusdev) {
foreach ($nics as $line) {
if (!empty($line)) {
exec('readlink /sys/class/net/'.$line,$linereturn);
preg_match_all($DBDF_PARTIAL_REGEX, $linereturn[0], $inuse);
foreach ($inuse[0] as $line) {
$lines[] = $line;
if(isset($linereturn[0])) {
preg_match_all($DBDF_PARTIAL_REGEX, $linereturn[0], $inuse);
foreach ($inuse[0] as $line) {
$lines[] = $line;
}
}
unset($inuse);
unset($linereturn);
Expand Down

0 comments on commit 8120959

Please sign in to comment.