patch warning in download classification

This commit is contained in:
mappu 2016-04-19 19:34:52 +12:00
parent 0f6cabe3ee
commit 20d9ea66e5

View File

@ -176,14 +176,14 @@ class CProject {
// be assigned to the newest (topmost) entry // be assigned to the newest (topmost) entry
$found_idx = []; $found_idx = [];
$render_per_tag = []; $render_per_tag = [];
foreach(array_keys($known_tags) as $tagname) {
$render_per_tag[$tagname] = [];
}
foreach($this->downloads as $idx => $filename) { foreach($this->downloads as $idx => $filename) {
foreach(array_keys($known_tags) as $tagname) { foreach(array_keys($known_tags) as $tagname) {
if (stripos($filename, $tagname) !== false) { if (stripos($filename, $tagname) !== false) {
$found_idx[$idx] = $tagname; $found_idx[$idx] = $tagname;
if (! isset($render_per_tag[$tagname])) {
$render_per_tag[$tagname] = [];
}
$render_per_tag[$tagname][$idx] = $filename; $render_per_tag[$tagname][$idx] = $filename;
break; // next file break; // next file
} }