From 07d1333648750a0173727939655e4543727c37c3 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Tue, 10 Mar 2009 16:30:47 -0600 Subject: [PATCH] Bug #8062: Fix link parsing We need to make sure there is a space before target/href or else params contained in a URL can confuse the regexp if named target or href. --- imp/lib/Mime/Viewer/Html.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/imp/lib/Mime/Viewer/Html.php b/imp/lib/Mime/Viewer/Html.php index 69000c64a..bb0801d17 100644 --- a/imp/lib/Mime/Viewer/Html.php +++ b/imp/lib/Mime/Viewer/Html.php @@ -170,11 +170,11 @@ class IMP_Horde_Mime_Viewer_Html extends Horde_Mime_Viewer_Html * mailto: links, links that have an "#xyz" anchor and ignore * all links that already have a target. */ $data = preg_replace( - array('/]*\s*href=["\']?(#|mailto:))/i', - '/]*)\s*target=["\']?[^>"\'\s]*["\']?/i', + array('/]*\s+href=["\']?(#|mailto:))/i', + '/]*)\s+target=["\']?[^>"\'\s]*["\']?/i', '/]*\s*href=["\']?(#|mailto:))/i', - '/]*)\s*target=["\']?[^>"\'\s]*["\']?/i', + '/]*\s+href=["\']?(#|mailto:))/i', + '/]*)\s+target=["\']?[^>"\'\s]*["\']?/i', '/