mirror of
https://github.com/YGGverse/YGGo.git
synced 2025-01-24 21:44:59 +00:00
allow empty search queries
This commit is contained in:
parent
d119756a41
commit
cc0cca346b
@ -22,16 +22,8 @@ $q = !empty($_GET['q']) ? Filter::url($_GET['q']) : '';
|
|||||||
$p = !empty($_GET['p']) ? (int) $_GET['p'] : 1;
|
$p = !empty($_GET['p']) ? (int) $_GET['p'] : 1;
|
||||||
|
|
||||||
// Search request
|
// 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);
|
||||||
$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 = [];
|
|
||||||
}
|
|
||||||
|
|
||||||
// Mime list
|
// Mime list
|
||||||
$hostPagesMime = $sphinx->searchHostPagesMime(Filter::searchQuery($q, $m));
|
$hostPagesMime = $sphinx->searchHostPagesMime(Filter::searchQuery($q, $m));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user