From 8416a663f8e1d3650dbef550a7be7ddd4e93a30e Mon Sep 17 00:00:00 2001 From: Stefan Brand Date: Tue, 8 Feb 2022 20:55:21 +0100 Subject: [PATCH] Filter Empty Elements From Tag Array --- index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.php b/index.php index 7f263e0..21b5835 100644 --- a/index.php +++ b/index.php @@ -141,7 +141,7 @@ if (!empty($curfiles)| !empty($dirs)) { foreach ($curfiles as $index => $image) { $data['imageurl'] = $imageurl.$dir.'/'.$image; $data['imagename'] = $image; - $data['tags'] = explode(" ", pathinfo(trim(strstr(strtolower($image), ' - '), " -"))['filename']); + $data['tags'] = array_filter(explode(" ", pathinfo(trim(strstr(strtolower($image), ' - '), " -"))['filename'])); } Template::view('tpl/single.html', $data); }