Skip to content

Commit

Permalink
Add link exceptions for 'viber' and 'tel'.
Browse files Browse the repository at this point in the history
  • Loading branch information
ivopetkov committed Sep 10, 2024
1 parent 0948ae9 commit 9d1c054
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion classes/Audits/Internal/Utilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '';
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 9d1c054

Please sign in to comment.