From 6ac95d9cf1459a2edada2eee323a13334e65b714 Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Sun, 12 Jul 2015 11:36:42 +0200 Subject: [PATCH] Fixes warning 'Undefined index: searchtags' while filtering by tags. Happened if there were not any searchtags already present in the query. --- index.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/index.php b/index.php index 5f173f4..a0195db 100644 --- a/index.php +++ b/index.php @@ -1122,7 +1122,11 @@ function renderPage() // Check if this tag is already in the search query and ignore it if it is. // Each tag is always separated by a space - $current_tags = explode(' ', $params['searchtags']); + if (isset($params['searchtags'])) { + $current_tags = explode(' ', $params['searchtags']); + } else { + $current_tags = array(); + } $addtag = true; foreach ($current_tags as $value) { if ($value === $_GET['addtag']) {