aboutsummaryrefslogtreecommitdiffhomepage
path: root/index.php
diff options
context:
space:
mode:
Diffstat (limited to 'index.php')
-rw-r--r--index.php18
1 files changed, 15 insertions, 3 deletions
diff --git a/index.php b/index.php
index 5c21c2f6..c96d0136 100644
--- a/index.php
+++ b/index.php
@@ -1609,7 +1609,15 @@ function renderPage($conf, $pluginManager, $LINKSDB)
1609function buildLinkList($PAGE,$LINKSDB, $conf, $pluginManager) 1609function buildLinkList($PAGE,$LINKSDB, $conf, $pluginManager)
1610{ 1610{
1611 // Used in templates 1611 // Used in templates
1612 $searchtags = !empty($_GET['searchtags']) ? escape(normalize_spaces($_GET['searchtags'])) : ''; 1612 if (isset($_GET['searchtags'])) {
1613 if (! empty($_GET['searchtags'])) {
1614 $searchtags = escape(normalize_spaces($_GET['searchtags']));
1615 } else {
1616 $searchtags = false;
1617 }
1618 } else {
1619 $searchtags = '';
1620 }
1613 $searchterm = !empty($_GET['searchterm']) ? escape(normalize_spaces($_GET['searchterm'])) : ''; 1621 $searchterm = !empty($_GET['searchterm']) ? escape(normalize_spaces($_GET['searchterm'])) : '';
1614 1622
1615 // Smallhash filter 1623 // Smallhash filter
@@ -1624,7 +1632,11 @@ function buildLinkList($PAGE,$LINKSDB, $conf, $pluginManager)
1624 } else { 1632 } else {
1625 // Filter links according search parameters. 1633 // Filter links according search parameters.
1626 $visibility = ! empty($_SESSION['privateonly']) ? 'private' : 'all'; 1634 $visibility = ! empty($_SESSION['privateonly']) ? 'private' : 'all';
1627 $linksToDisplay = $LINKSDB->filterSearch($_GET, false, $visibility); 1635 $request = [
1636 'searchtags' => $searchtags,
1637 'searchterm' => $searchterm,
1638 ];
1639 $linksToDisplay = $LINKSDB->filterSearch($request, false, $visibility);
1628 } 1640 }
1629 1641
1630 // ---- Handle paging. 1642 // ---- Handle paging.
@@ -1671,7 +1683,7 @@ function buildLinkList($PAGE,$LINKSDB, $conf, $pluginManager)
1671 } 1683 }
1672 1684
1673 // Compute paging navigation 1685 // Compute paging navigation
1674 $searchtagsUrl = empty($searchtags) ? '' : '&searchtags=' . urlencode($searchtags); 1686 $searchtagsUrl = $searchtags === '' ? '' : '&searchtags=' . urlencode($searchtags);
1675 $searchtermUrl = empty($searchterm) ? '' : '&searchterm=' . urlencode($searchterm); 1687 $searchtermUrl = empty($searchterm) ? '' : '&searchterm=' . urlencode($searchterm);
1676 $previous_page_url = ''; 1688 $previous_page_url = '';
1677 if ($i != count($keys)) { 1689 if ($i != count($keys)) {