File 17a3374197086474fded2ea4a2c738284d75e89c.patch of Package mlmmj-webarchiver

From 17a3374197086474fded2ea4a2c738284d75e89c Mon Sep 17 00:00:00 2001
From: Tomasz Kramkowski <tk@the-tk.com>
Date: Fri, 4 Aug 2017 23:51:42 +0100
Subject: [PATCH] index.php, index.php.newlist: explicitly set *lists and
 archived_months

When these variables are first set using .= they raise an error about
them being undefined. Explicitly setting them should get rid of the error
and avoid an error if there are no list directories (this would be odd)
or if there are no months for a list (maybe not quite as unusual).

Signed-off-by: Tomasz Kramkowski <tk@the-tk.com>
---
 mlmmj-webarchiver/index.php.newlist | 1 +
 mlmmj-webarchiver/skel/index.php    | 1 +
 2 files changed, 2 insertions(+)

diff --git a/mlmmj-webarchiver/index.php.newlist b/mlmmj-webarchiver/index.php.newlist
index 425d4b2..1d78851 100644
--- a/mlmmj-webarchiver/index.php.newlist
+++ b/mlmmj-webarchiver/index.php.newlist
@@ -10,6 +10,7 @@ while($file = readdir($handle)) {
 closedir($handle);
 rsort($files);
 reset($files);
+$archived_months = "";
 foreach($files as $k => $file) {
   if (! isset($year) || $year != substr($file, 0, 4)) {
     $year = substr($file, 0, 4);
diff --git a/mlmmj-webarchiver/skel/index.php b/mlmmj-webarchiver/skel/index.php
index 7247927..64ebd55 100644
--- a/mlmmj-webarchiver/skel/index.php
+++ b/mlmmj-webarchiver/skel/index.php
@@ -2,6 +2,7 @@
   $baselistdir = getcwd();
   $mlist = substr(strrchr ($baselistdir, "/"), 1);
   $mlistdir = opendir($baselistdir);
+  $navlists = $bodylists = "";
   while($file = readdir($mlistdir)) {
     if($file != "." && $file != ".." && $file != "images" && $file != "style"
        && is_dir($baselistdir . "/" . $file)) {
-- 
GitLab

openSUSE Build Service is sponsored by