Skip to content

Commit

Permalink
fixup! Feat: link checking for phishing detection
Browse files Browse the repository at this point in the history
Signed-off-by: Hamza Mahjoubi <[email protected]>
  • Loading branch information
hamza221 committed Aug 13, 2024
1 parent 37da2be commit d8c14ae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Service/PhishingDetection/LinkCheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function run(string $htmlMessage) : PhishingDetectionResult {
$un = new Normalizer($zipped['href']);
$url = $un->normalize();
if($this->textLooksLikeALink($zipped['linkText'])) {
if (str_contains($zipped['linkText'], $url) || str_contains($url, $zipped['linkText']) === false) {
if(parse_url($url, PHP_URL_HOST) !== parse_url($zipped['linkText'], PHP_URL_HOST)) {
$results[] = [
'href' => $url,
'linkText' => $zipped['linkText'],
Expand Down

0 comments on commit d8c14ae

Please sign in to comment.