move link generation into the loop

This commit is contained in:
Tobias Diekershoff 2019-11-03 19:57:32 +01:00
parent 17061b22d2
commit b7ecc62cc8

View file

@ -42,13 +42,12 @@ final class Item
$folders = [];
$first = true;
foreach (FileTag::fileToArray($item['file'] ?? '', 'category') as $savedFolderName) {
if (!empty($item['author-link'])) {
$url = $item['author-link'] . "?category=" . rawurlencode($savedFolderName);
} else {
$url = '#';
}
foreach (FileTag::fileToArray($item['file'] ?? '', 'category') as $savedFolderName) {
$categories[] = [
'name' => $savedFolderName,
'url' => $url,