From: Michael M Slusarz Date: Thu, 12 Aug 2010 22:59:47 +0000 (-0600) Subject: Tweaks to phishing algorithm X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=9cb2c070a64ec6db903cbe434a616b0fd1b3b28b;p=horde.git Tweaks to phishing algorithm --- diff --git a/framework/Mime_Viewer/lib/Horde/Mime/Viewer/Html.php b/framework/Mime_Viewer/lib/Horde/Mime/Viewer/Html.php index 6bf1b1eba..b42051adc 100644 --- a/framework/Mime_Viewer/lib/Horde/Mime/Viewer/Html.php +++ b/framework/Mime_Viewer/lib/Horde/Mime/Viewer/Html.php @@ -256,8 +256,16 @@ class Horde_Mime_Viewer_Html extends Horde_Mime_Viewer_Base /* Check for case where text is just the domain name. */ if (!isset($text_url['host'])) { - if (!isset($text_url['path']) || - !preg_match("/^[^\.\s\/]+(?:\.[^\.\s]+)+$/", $text_url['path'])) { + if (!isset($text_url['path'])) { + return false; + } + + /* Path info may include path, so remove that. */ + if (($pos = strpos($text_url['path'], '/')) !== false) { + $text_url['path'] = substr($text_url['path'], 0, $pos); + } + + if (!preg_match("/^[^\.\s\/]+(?:\.[^\.\s]+)+$/", $text_url['path'])) { return false; }