summaryrefslogtreecommitdiff
path: root/includes/inc_vdr.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/inc_vdr.php')
-rwxr-xr-xincludes/inc_vdr.php37
1 files changed, 35 insertions, 2 deletions
diff --git a/includes/inc_vdr.php b/includes/inc_vdr.php
index 1ab233f..d8ebf93 100755
--- a/includes/inc_vdr.php
+++ b/includes/inc_vdr.php
@@ -170,7 +170,18 @@ function vdrlistcategories()
print "<li class=\"menu\"><a class=\"noeffect\" href=\"javascript:sendForm('All');\"><span class=\"name\">All channels</span><span class=\"arrow\"></span></a></li>\r\n";
print "<form name=\"All channels\" id=\"All\" method=\"post\" action=\"index.php\"><input name=\"action\" type=\"hidden\" id=\"action\" value=\"listchannels\"/><input name=\"cat\" type=\"hidden\" id=\"cat\" value=\"All\" /></form>\r\n";
+ if (!file_exists($vdrchannels))
+ {
+ print "Error: channels file not found";
+ return;
+ }
+
$fp = fopen ($vdrchannels,"r");
+ if (!fp)
+ {
+ print "Unable to open channels file";
+ return;
+ }
while ($line = fgets($fp, 1024))
{
// Check if it is a categorie
@@ -203,7 +214,18 @@ function vdrlistchannels($category = "NULL")
else
$cat_found=0;
- $fp = fopen ($vdrchannels,"r");
+ if (!file_exists($vdrchannels))
+ {
+ print "Error: channels file not found";
+ return;
+ }
+
+ $fp = fopen ($vdrchannels,"r");
+ if (!fp)
+ {
+ print "Unable to open channels file";
+ return;
+ }
while ($line = fgets($fp, 1024))
{
if ($cat_found)
@@ -265,7 +287,18 @@ function vdrlistchannelsdrop($chansel = "")
$chanselected = 0;
- $fp = fopen ($vdrchannels,"r");
+ if (!file_exists($vdrchannels))
+ {
+ print "Error: channels file not found";
+ return;
+ }
+
+ $fp = fopen ($vdrchannels,"r");
+ if (!fp)
+ {
+ print "Unable to open channels file";
+ return;
+ }
while ($line = fgets($fp, 1024))
{
if ($line[0] == ":")