hunting Undefined offset

This commit is contained in:
dg9vh 2016-05-25 13:44:49 +00:00
parent f4d5c16486
commit 09e8c929d1

View file

@ -133,7 +133,9 @@ function getHeardList($logLines) {
$lineTokens = explode(", ",$logLine); $lineTokens = explode(", ",$logLine);
$duration = strtok($lineTokens[2], " "); $duration = strtok($lineTokens[2], " ");
$loss = $lineTokens[3]; if (array_key_exists(3,$lineTokens)) {
$loss = $lineTokens[3];
}
// if RF-Packet, no LOSS would be reported, so BER is in LOSS position // if RF-Packet, no LOSS would be reported, so BER is in LOSS position
if (startsWith($loss,"BER")) { if (startsWith($loss,"BER")) {
@ -141,7 +143,9 @@ function getHeardList($logLines) {
$loss = ""; $loss = "";
} else { } else {
$loss = strtok($loss, " "); $loss = strtok($loss, " ");
$ber = substr($lineTokens[4], 5); if (array_key_exists(4,$lineTokens)) {
$ber = substr($lineTokens[4], 5);
}
} }
if (strpos($logLine,"ended RF data") || strpos($logLine,"ended network")) { if (strpos($logLine,"ended RF data") || strpos($logLine,"ended network")) {