mirror of
https://github.com/YGGverse/Yo.git
synced 2025-01-29 16:04:20 +00:00
fix url check conditions
This commit is contained in:
parent
ff8b88f49b
commit
133548a98c
@ -28,7 +28,7 @@ $url = trim($argv[1]);
|
|||||||
$crc32url = crc32($url);
|
$crc32url = crc32($url);
|
||||||
|
|
||||||
// Check URL for exist
|
// Check URL for exist
|
||||||
$result = $index->search('@url "' . $url . '"')
|
$result = $index->search('')
|
||||||
->filter('crc32url', $crc32url)
|
->filter('crc32url', $crc32url)
|
||||||
->limit(1)
|
->limit(1)
|
||||||
->get();
|
->get();
|
||||||
|
@ -255,7 +255,7 @@ foreach($search->get() as $document)
|
|||||||
$url = trim($url);
|
$url = trim($url);
|
||||||
$crc32url = crc32($url);
|
$crc32url = crc32($url);
|
||||||
|
|
||||||
if (!$index->search('@url "' . $url . '"')
|
if (!$index->search('')
|
||||||
->filter('crc32url', $crc32url)
|
->filter('crc32url', $crc32url)
|
||||||
->limit(1)
|
->limit(1)
|
||||||
->get()
|
->get()
|
||||||
|
@ -127,7 +127,7 @@ for ($i = 0; $i <= $total; $i++)
|
|||||||
// Check for unique URL requested
|
// Check for unique URL requested
|
||||||
if (isset($argv[6]))
|
if (isset($argv[6]))
|
||||||
{
|
{
|
||||||
$local = $index->search('@url "' . trim($url) . '"')
|
$local = $index->search('')
|
||||||
->filter('crc32url', $crc32url)
|
->filter('crc32url', $crc32url)
|
||||||
->limit(1)
|
->limit(1)
|
||||||
->get();
|
->get();
|
||||||
|
@ -59,11 +59,11 @@ if ($config->webui->search->index->request->url->enabled && filter_var($q, FILTE
|
|||||||
$crc32url = crc32($url);
|
$crc32url = crc32($url);
|
||||||
|
|
||||||
// Check URL for exist
|
// Check URL for exist
|
||||||
$exist = $index->search('@url "' . $url . '"')
|
$exist = $index->search('')
|
||||||
->filter('crc32url', $crc32url)
|
->filter('crc32url', $crc32url)
|
||||||
->limit(1)
|
->limit(1)
|
||||||
->get()
|
->get()
|
||||||
->getTotal();
|
->getTotal();
|
||||||
|
|
||||||
if ($exist)
|
if ($exist)
|
||||||
{
|
{
|
||||||
@ -107,7 +107,7 @@ switch (true)
|
|||||||
{
|
{
|
||||||
case filter_var($q, FILTER_VALIDATE_URL):
|
case filter_var($q, FILTER_VALIDATE_URL):
|
||||||
|
|
||||||
$query = $index->search('@url "' . $q . '"')->filter('crc32url', crc32($q));
|
$query = $index->search('')->filter('crc32url', crc32($q));
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user