Skip to content

Commit

Permalink
For phishing, if link text is the end of the original URL path consid…
Browse files Browse the repository at this point in the history
…er it to be safe
  • Loading branch information
slusarz committed Mar 5, 2015
1 parent 2a27881 commit 0cff7f9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions framework/Mime_Viewer/lib/Horde/Mime/Viewer/Html.php
Expand Up @@ -278,6 +278,14 @@ protected function _phishingCheck($href, $text)
return false;
}

/* If the path matches the end of the URL path, consider safe
* (most likely the link text is something like a shortened
* filename). */
if (isset($href_url['path']) &&
preg_match("/" . preg_quote($text_url['path']) . "$/", $href_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);
Expand Down

0 comments on commit 0cff7f9

Please sign in to comment.