diff options
author | ArthurHoaro <arthur@hoa.ro> | 2015-07-12 11:36:42 +0200 |
---|---|---|
committer | ArthurHoaro <arthur@hoa.ro> | 2015-07-12 11:36:42 +0200 |
commit | 6ac95d9cf1459a2edada2eee323a13334e65b714 (patch) | |
tree | 5cb6f4a81400fa5285c89b60bf5ce2f5baef31d1 /index.php | |
parent | 7bd3542b1b030070fa3412a2769f9632bd4e6d1b (diff) | |
download | Shaarli-6ac95d9cf1459a2edada2eee323a13334e65b714.tar.gz Shaarli-6ac95d9cf1459a2edada2eee323a13334e65b714.tar.zst Shaarli-6ac95d9cf1459a2edada2eee323a13334e65b714.zip |
Fixes warning 'Undefined index: searchtags' while filtering by tags.
Happened if there were not any searchtags already present in the query.
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -1122,7 +1122,11 @@ function renderPage() | |||
1122 | 1122 | ||
1123 | // Check if this tag is already in the search query and ignore it if it is. | 1123 | // Check if this tag is already in the search query and ignore it if it is. |
1124 | // Each tag is always separated by a space | 1124 | // Each tag is always separated by a space |
1125 | $current_tags = explode(' ', $params['searchtags']); | 1125 | if (isset($params['searchtags'])) { |
1126 | $current_tags = explode(' ', $params['searchtags']); | ||
1127 | } else { | ||
1128 | $current_tags = array(); | ||
1129 | } | ||
1126 | $addtag = true; | 1130 | $addtag = true; |
1127 | foreach ($current_tags as $value) { | 1131 | foreach ($current_tags as $value) { |
1128 | if ($value === $_GET['addtag']) { | 1132 | if ($value === $_GET['addtag']) { |