]> git.immae.eu Git - github/shaarli/Shaarli.git/commitdiff
Fixes warning 'Undefined index: searchtags' while filtering by tags.
authorArthurHoaro <arthur@hoa.ro>
Sun, 12 Jul 2015 09:36:42 +0000 (11:36 +0200)
committerArthurHoaro <arthur@hoa.ro>
Sun, 12 Jul 2015 09:36:42 +0000 (11:36 +0200)
Happened if there were not any searchtags already present in the query.

index.php

index 5f173f4dea3b58f4d08c2f9407b3e75305a0b67f..a0195db7919b2de6aa531c9dbb223336c4674c6b 100644 (file)
--- 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']) {