mirror of
https://github.com/YGGverse/Yo.git
synced 2025-03-12 13:21:29 +00:00
show random results on empty search request
This commit is contained in:
parent
6a9117757b
commit
3f7eb2f0e3
@ -105,6 +105,12 @@ if ($config->webui->search->index->request->url->enabled && filter_var($q, FILTE
|
|||||||
// Extended syntax corrections
|
// Extended syntax corrections
|
||||||
switch (true)
|
switch (true)
|
||||||
{
|
{
|
||||||
|
case empty($q):
|
||||||
|
|
||||||
|
$query = $index->search('')->sort('RAND()');
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
case filter_var($q, FILTER_VALIDATE_URL):
|
case filter_var($q, FILTER_VALIDATE_URL):
|
||||||
|
|
||||||
$query = $index->search('')->filter('crc32url', crc32($q));
|
$query = $index->search('')->filter('crc32url', crc32($q));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user