From: Michael M Slusarz Date: Fri, 23 Jul 2010 22:46:00 +0000 (-0600) Subject: Fix mailto: processing for link tags with pre-existing target attribute X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=d80a637f1af7643e33582eb483ebb5954ea88513;p=horde.git Fix mailto: processing for link tags with pre-existing target attribute --- diff --git a/imp/lib/Mime/Viewer/Html.php b/imp/lib/Mime/Viewer/Html.php index 69fe92ec3..489b80749 100644 --- a/imp/lib/Mime/Viewer/Html.php +++ b/imp/lib/Mime/Viewer/Html.php @@ -283,12 +283,12 @@ class IMP_Horde_Mime_Viewer_Html extends Horde_Mime_Viewer_Html /* Convert links to open in new windows. Ignore * mailto: links, links that have an "#xyz" anchor, * and links that already have a target. */ - if (!$node->hasAttribute('target') && - $node->hasAttribute('href')) { + if ($node->hasAttribute('href')) { $url = parse_url($node->getAttribute('href')); if (isset($url['scheme']) && ($url['scheme'] == 'mailto')) { $node->setAttribute('href', IMP::composeLink($node->getAttribute('href'))); - } elseif (empty($url['fragment'])) { + } elseif (!$node->hasAttribute('target') && + empty($url['fragment'])) { $node->setAttribute('target', $this->_imptmp['target']); } }