Skip to content

Commit

Permalink
Fix "FastCGI-stderr: PHP Notice: Undefined offset: 3" error
Browse files Browse the repository at this point in the history
Signed-off-by: DL6ER <[email protected]>
  • Loading branch information
DL6ER committed Apr 15, 2018
1 parent cd6684a commit a5635e7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions api_FTL.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
foreach($return as $line)
{
$tmp = explode(" ",$line);
if(count($tmp) === 4)
if(count($tmp) > 3)
$top_ads[$tmp[2]." (".$tmp[3].")"] = intval($tmp[1]);
else
$top_ads[$tmp[2]] = intval($tmp[1]);
Expand Down Expand Up @@ -161,7 +161,7 @@
foreach($return as $line)
{
$tmp = explode(" ",$line);
if(count($tmp) > 2 && strlen($tmp[3]) > 0)
if(count($tmp) > 3 && strlen($tmp[3]) > 0)
$top_clients[$tmp[3]."|".$tmp[2]] = intval($tmp[1]);
else
$top_clients[$tmp[2]] = intval($tmp[1]);
Expand All @@ -186,7 +186,7 @@
foreach($return as $line)
{
$tmp = explode(" ",$line);
if(count($tmp) > 2 && strlen($tmp[3]) > 0)
if(count($tmp) > 3 && strlen($tmp[3]) > 0)
$forward_dest[$tmp[3]."|".$tmp[2]] = floatval($tmp[1]);
else
$forward_dest[$tmp[2]] = floatval($tmp[1]);
Expand Down Expand Up @@ -282,7 +282,7 @@
foreach($return as $line)
{
$tmp = explode(" ",$line);
if(count($tmp) == 4)
if(count($tmp) > 3)
{
$forward_dest[$tmp[3]."|".$tmp[2]] = floatval($tmp[1]);
}
Expand Down Expand Up @@ -321,7 +321,7 @@
foreach($return as $line)
{
$tmp = explode(" ",$line);
if(count($tmp) > 2 && strlen($tmp[3]) > 0)
if(count($tmp) > 3 && strlen($tmp[3]) > 0)
$client_names[$tmp[3]."|".$tmp[2]] = floatval($tmp[1]);
else
$client_names[$tmp[2]] = floatval($tmp[1]);
Expand Down

0 comments on commit a5635e7

Please sign in to comment.