From 9d1c054b631d5790536dc192b322b447d2ebc007 Mon Sep 17 00:00:00 2001 From: Ivo Petkov Date: Tue, 10 Sep 2024 17:53:55 +0300 Subject: [PATCH] Add link exceptions for 'viber' and 'tel'. --- classes/Audits/Internal/Utilities.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/classes/Audits/Internal/Utilities.php b/classes/Audits/Internal/Utilities.php index 41d6e21..94a3254 100644 --- a/classes/Audits/Internal/Utilities.php +++ b/classes/Audits/Internal/Utilities.php @@ -65,7 +65,10 @@ static function initializeAudit(string $id): void $maxPagesCount = $data['m']; $robotsURL = $data['u'] . 'robots.txt'; + $robotsURL = 'https://example.alle.bg/robots.txt'; $result = self::makeRequest($robotsURL); + // print_r($result); + // exit; if ($result['status'] === 200) { $robotsLines = explode("\n", $result['content']); $sitemapURL = ''; @@ -181,7 +184,7 @@ static function checkPage(string $id, string $pageID): void $counter = 0; foreach ($links as $link) { $linkLocation = trim((string)$link->getAttribute('href')); - if (strlen($linkLocation) > 0 && strpos($linkLocation, 'javascript:') !== 0 && strpos($linkLocation, 'mailto:') !== 0 && strpos($linkLocation, '#') !== 0) { + if (strlen($linkLocation) > 0 && strpos($linkLocation, 'javascript:') !== 0 && strpos($linkLocation, 'mailto:') !== 0 && strpos($linkLocation, 'tel:') !== 0 && strpos($linkLocation, 'viber:') !== 0 && strpos($linkLocation, '#') !== 0) { $counter++; $linkID = md5($linkLocation . '-' . $counter); $shortURL = self::getShortURL($data['u'], $linkLocation);