From cc0cca346b513ac2c931b0c4081f696da9c1d07e Mon Sep 17 00:00:00 2001 From: ghost Date: Tue, 1 Aug 2023 16:47:39 +0300 Subject: [PATCH] allow empty search queries --- public/search.php | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/public/search.php b/public/search.php index a55e39d..64c805e 100644 --- a/public/search.php +++ b/public/search.php @@ -22,16 +22,8 @@ $q = !empty($_GET['q']) ? Filter::url($_GET['q']) : ''; $p = !empty($_GET['p']) ? (int) $_GET['p'] : 1; // Search request -if (!empty($q)) { - - $resultsTotal = $sphinx->searchHostPagesTotal(Filter::searchQuery($q, $m), $t); - $results = $sphinx->searchHostPages(Filter::searchQuery($q, $m), $t, $p * WEBSITE_PAGINATION_SEARCH_PAGE_RESULTS_LIMIT - WEBSITE_PAGINATION_SEARCH_PAGE_RESULTS_LIMIT, WEBSITE_PAGINATION_SEARCH_PAGE_RESULTS_LIMIT, $resultsTotal); - -} else { - - $resultsTotal = 0; - $results = []; -} +$resultsTotal = $sphinx->searchHostPagesTotal(Filter::searchQuery($q, $m), $t); +$results = $sphinx->searchHostPages(Filter::searchQuery($q, $m), $t, $p * WEBSITE_PAGINATION_SEARCH_PAGE_RESULTS_LIMIT - WEBSITE_PAGINATION_SEARCH_PAGE_RESULTS_LIMIT, WEBSITE_PAGINATION_SEARCH_PAGE_RESULTS_LIMIT, $resultsTotal); // Mime list $hostPagesMime = $sphinx->searchHostPagesMime(Filter::searchQuery($q, $m));