From 2c6d232bba86c772bb53d9b9889070fb2f65fd82 Mon Sep 17 00:00:00 2001 From: dg9vh Date: Sat, 1 Oct 2016 08:36:49 +0000 Subject: [PATCH] fixed https://github.com/dg9vh/MMDVMHost-Dashboard/issues/46 --- include/functions.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/include/functions.php b/include/functions.php index 44b2c27..cac3214 100644 --- a/include/functions.php +++ b/include/functions.php @@ -502,10 +502,12 @@ function getActualReflector($logLines, $mode) { function getActiveYSFReflectors() { $reflectorlist = Array(); $file = fopen(YSFHOSTSPATH."/".YSFHOSTSFILENAME, 'r'); - while (($line = fgetcsv($file, 1000, ";")) !== FALSE) { - //$line is an array of the csv elements -// print_r($line); - array_push($reflectorlist, array($line[1], $line[2], $line[0], $line[5])); + if ($file) { + while (($line = fgetcsv($file, 1000, ";")) !== FALSE) { + //$line is an array of the csv elements + // print_r($line); + array_push($reflectorlist, array($line[1], $line[2], $line[0], $line[5])); + } } fclose($file); return $reflectorlist;