From b3c668706bf5b2c04ec42cfccc4de8cc829bbd97 Mon Sep 17 00:00:00 2001 From: ghost Date: Sat, 8 Apr 2023 19:14:04 +0300 Subject: [PATCH] trim path levels in the relative links --- crontab/crawler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crontab/crawler.php b/crontab/crawler.php index fe8ffb9..a8a8c72 100644 --- a/crontab/crawler.php +++ b/crontab/crawler.php @@ -126,7 +126,7 @@ foreach ($db->getCrawlQueue(CRAWL_PAGE_LIMIT, time() - CRAWL_PAGE_SECONDS_OFFSET $href = $queueHostPage->scheme . '://' . $queueHostPage->name . ($queueHostPage->port ? ':' . $queueHostPage->port : '') . - '/' . ltrim($href, '/'); + '/' . ltrim(str_replace(['./', '../'], '', $href), '/'); } // Validate formatted link