diff --git a/lib/CProject.php b/lib/CProject.php index e0b35d5..a7e582b 100644 --- a/lib/CProject.php +++ b/lib/CProject.php @@ -44,7 +44,7 @@ class CProject { $this->longdesc = file_get_contents($this->dir.'README.txt'); $this->longdesc = str_replace("\r", "", $this->longdesc); // filter windows CR $this->longdesc = preg_replace("~[\s\t]*$~s", "", $this->longdesc); // filter trailing spaces at line endings - + // Guess 'last update' time if (preg_match('~\n(\d\d\d\d-\d\d-\d\d)~', $this->longdesc, $matches)) { // Use first date entry (assumed to be a CHANGELOG) @@ -176,14 +176,14 @@ class CProject { // be assigned to the newest (topmost) entry $found_idx = []; $render_per_tag = []; + foreach(array_keys($known_tags) as $tagname) { + $render_per_tag[$tagname] = []; + } foreach($this->downloads as $idx => $filename) { foreach(array_keys($known_tags) as $tagname) { if (stripos($filename, $tagname) !== false) { $found_idx[$idx] = $tagname; - if (! isset($render_per_tag[$tagname])) { - $render_per_tag[$tagname] = []; - } $render_per_tag[$tagname][$idx] = $filename; break; // next file }