diff options
author | ArthurHoaro <arthur@hoa.ro> | 2016-01-03 15:29:15 +0100 |
---|---|---|
committer | ArthurHoaro <arthur@hoa.ro> | 2016-01-06 19:53:25 +0100 |
commit | 2c75f8e780e674ddb42c935b54ed6c39925ba07c (patch) | |
tree | b2d3107ef336a89e372d66477f439e9b5b82efce /index.php | |
parent | 822bffced8212e7f34bcb2ad063b31a78bd57bdb (diff) | |
download | Shaarli-2c75f8e780e674ddb42c935b54ed6c39925ba07c.tar.gz Shaarli-2c75f8e780e674ddb42c935b54ed6c39925ba07c.tar.zst Shaarli-2c75f8e780e674ddb42c935b54ed6c39925ba07c.zip |
Fixes #426 - Do not filter with blank tags.
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -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)); |