diff options
-rw-r--r-- | application/LinkDB.php | 2 | ||||
-rw-r--r-- | index.php | 10 |
2 files changed, 7 insertions, 5 deletions
diff --git a/application/LinkDB.php b/application/LinkDB.php index be7d9016..16848519 100644 --- a/application/LinkDB.php +++ b/application/LinkDB.php | |||
@@ -351,7 +351,7 @@ You use the community supported version of the original Shaarli project, by Seba | |||
351 | */ | 351 | */ |
352 | public function filter($type, $request, $casesensitive = false, $privateonly = false) { | 352 | public function filter($type, $request, $casesensitive = false, $privateonly = false) { |
353 | $requestFilter = is_array($request) ? implode(' ', $request) : $request; | 353 | $requestFilter = is_array($request) ? implode(' ', $request) : $request; |
354 | return $this->linkFilter->filter($type, $requestFilter, $casesensitive, $privateonly); | 354 | return $this->linkFilter->filter($type, trim($requestFilter), $casesensitive, $privateonly); |
355 | } | 355 | } |
356 | 356 | ||
357 | /** | 357 | /** |
@@ -1298,12 +1298,14 @@ function renderPage() | |||
1298 | 1298 | ||
1299 | if (isset($params['searchtags'])) { | 1299 | if (isset($params['searchtags'])) { |
1300 | $tags = explode(' ', $params['searchtags']); | 1300 | $tags = explode(' ', $params['searchtags']); |
1301 | $tags=array_diff($tags, array($_GET['removetag'])); // Remove value from array $tags. | 1301 | // Remove value from array $tags. |
1302 | if (count($tags)==0) { | 1302 | $tags = array_diff($tags, array($_GET['removetag'])); |
1303 | $params['searchtags'] = implode(' ',$tags); | ||
1304 | |||
1305 | if (empty($params['searchtags'])) { | ||
1303 | unset($params['searchtags']); | 1306 | unset($params['searchtags']); |
1304 | } else { | ||
1305 | $params['searchtags'] = implode(' ',$tags); | ||
1306 | } | 1307 | } |
1308 | |||
1307 | unset($params['page']); // We also remove page (keeping the same page has no sense, since the results are different) | 1309 | unset($params['page']); // We also remove page (keeping the same page has no sense, since the results are different) |
1308 | } | 1310 | } |
1309 | header('Location: ?'.http_build_query($params)); | 1311 | header('Location: ?'.http_build_query($params)); |