From 01437065e31386fa13d2165bd3e289c1441028f1 Mon Sep 17 00:00:00 2001 From: ghost Date: Sat, 25 Nov 2023 18:13:58 +0200 Subject: [PATCH] fix duplicates validation --- src/cli/yggo/import.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/cli/yggo/import.php b/src/cli/yggo/import.php index 10d2e3c..6cfde5c 100644 --- a/src/cli/yggo/import.php +++ b/src/cli/yggo/import.php @@ -121,12 +121,14 @@ for ($i = 0; $i <= $total; $i++) foreach ($query->fetchAll() as $remote) { - $url = $remote->scheme . '://' . $remote->name . ($remote->port ? ':' . $remote->port : false) . $remote->uri; + $url = $remote->scheme . '://' . $remote->name . ($remote->port ? ':' . $remote->port : false) . $remote->uri; + $crc32url = crc32($url); // Check for unique URL requested if (isset($argv[6])) { - $local = $index->search('@url "' . trim($argv[1]) . '"') + $local = $index->search('@url "' . trim($url) . '"') + ->filter('crc32url', $crc32url) ->limit(1) ->get();