]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - index.php
Fixes #426 - Do not filter with blank tags.
[github/shaarli/Shaarli.git] / index.php
index 1664c01b6ec192d24a2a6155f651f5db3e12d1b2..2815f02e5e40e93f946051a2580da138f0744ca4 100644 (file)
--- a/index.php
+++ b/index.php
@@ -1298,12 +1298,14 @@ function renderPage()
 
         if (isset($params['searchtags'])) {
             $tags = explode(' ', $params['searchtags']);
-            $tags=array_diff($tags, array($_GET['removetag'])); // Remove value from array $tags.
-            if (count($tags)==0) {
+            // Remove value from array $tags.
+            $tags = array_diff($tags, array($_GET['removetag']));
+            $params['searchtags'] = implode(' ',$tags);
+
+            if (empty($params['searchtags'])) {
                 unset($params['searchtags']);
-            } else {
-                $params['searchtags'] = implode(' ',$tags);
             }
+
             unset($params['page']); // We also remove page (keeping the same page has no sense, since the results are different)
         }
         header('Location: ?'.http_build_query($params));