[Tickets #8062] Re: Incomplete parsing of Href link

bugs at horde.org bugs at horde.org
Thu Mar 12 19:08:46 UTC 2009


DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: http://bugs.horde.org/ticket/8062
------------------------------------------------------------------------------
  Ticket             | 8062
  Updated By         | Michael Slusarz <slusarz at horde.org>
  Summary            | Incomplete parsing of  Href link
  Queue              | IMP
  Version            | 4.3.3
  Type               | Bug
-State              | Feedback
+State              | Resolved
  Priority           | 1. Low
  Milestone          |
  Patch              |
-Owners             |
+Owners             | Michael Slusarz
------------------------------------------------------------------------------


Michael Slusarz <slusarz at horde.org> (2009-03-12 15:08) wrote:

Hmmm... somehow my comment(s) got lost (probably due to the out of  
disk space issues on bugs@).  This has been fixed in IMP 4.3.4 and  
git.  This was the fix:

Author:     Michael M Slusarz <slusarz at curecanti.org>
AuthorDate: Tue Mar 10 16:30:47 2009 -0600
Commit:     Michael M Slusarz <slusarz at curecanti.org>
CommitDate: Tue Mar 10 16:30:47 2009 -0600

     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 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/imp/lib/Mime/Viewer/Html.php b/imp/lib/Mime/Viewer/Html.php
index 69000c6..bb0801d 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_Viewe~
           * mailto: links, links that have an "#xyz" anchor and ignore
           * all links that already have a target. */
          $data = preg_replace(
-            array('/<a\s([^>]*\s*href=["\']?(#|mailto:))/i',
-                  '/<a\s([^>]*)\s*target=["\']?[^>"\'\s]*["\']?/i',
+            array('/<a\s([^>]*\s+href=["\']?(#|mailto:))/i',
+                  '/<a\s([^>]*)\s+target=["\']?[^>"\'\s]*["\']?/i',
                    '/<a\s/i',
-                  '/<area\s([^>]*\s*href=["\']?(#|mailto:))/i',
-                  '/<area\s([^>]*)\s*target=["\']?[^>"\'\s]*["\']?/i',
+                  '/<area\s([^>]*\s+href=["\']?(#|mailto:))/i',
+                  '/<area\s([^>]*)\s+target=["\']?[^>"\'\s]*["\']?/i',
                    '/<area\s/i',
                    "/\x01/",
                    "/\x02/"),








More information about the bugs mailing list