6.0.0-beta1
7/6/25

[#8062] Incomplete parsing of Href link
Summary Incomplete parsing of Href link
Queue IMP
Queue Version 4.3.3
Type Bug
State Resolved
Priority 1. Low
Owners slusarz (at) horde (dot) org
Requester dom.lalot (at) gmail (dot) com
Created 03/09/2009 (5963 days ago)
Due
Updated 06/30/2010 (5485 days ago)
Assigned 06/07/2010 (5508 days ago)
Resolved 06/30/2010 (5485 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
06/30/2010 09:55:58 PM Michael Slusarz State ⇒ Resolved
 
06/30/2010 09:55:49 PM CVS Commit Comment #11 Reply to this comment
Changes have been made in CVS for this ticket:

Bug: 8062
Merge from git: 178f8f7
http://cvs.horde.org/diff.php/imp/lib/MIME/Viewer/html.php?rt=horde&r1=1.75.2.40&r2=1.75.2.41&ty=u
06/30/2010 09:51:54 PM Git Commit Comment #10 Reply to this comment
06/07/2010 09:17:30 AM Jan Schneider Comment #9
State ⇒ Assigned
Reply to this comment
This change breaks parsing all links that don't have at least two 
spaces inside the <a> and <area> tags before the href or target 
attributes. See the failing PEAR unit tests.
01/13/2010 12:00:34 AM CVS Commit Comment #8 Reply to this comment
Changes have been made in Git for this ticket:

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.

http://git.horde.org/diff.php/imp/lib/Mime/Viewer/Html.php?rt=horde-git&r1=7dc3f0b944c0bebc4d64f09f749ebf6929f998fc&r2=07d1333648750a0173727939655e4543727c37c3
03/13/2009 04:28:19 PM Michael Slusarz Comment #7 Reply to this comment

[Show Quoted Text - 11 lines]
No, nothing is broken.  CVS ids in patches are always one less than 
the current version (IIRC, the diff is taken before the id is updated 
to the current version).
03/13/2009 07:54:17 AM dom (dot) lalot (at) gmail (dot) com Comment #6 Reply to this comment
Thanks Mickael for the patch, but I can't apply it



Is there a version mismatch?



If I look at the diff:



- * $Horde: imp/lib/MIME/Viewer/html.php,v 1.75.2.37 2008/09/24 
17:21:42 jan Exp $

+ * $Horde: imp/lib/MIME/Viewer/html.php,v 1.75.2.38 2009/01/06 
15:24:09 jan Exp $



I'm already at 1.75.2.38 and the patch is to go to 1.75.2.39

Is there something broken?



So, I can't apply the patch!



Dom
03/12/2009 07:08:46 PM Michael Slusarz Comment #4
State ⇒ Resolved
Assigned to Michael Slusarz
Reply to this comment
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@curecanti.org>

AuthorDate: Tue Mar 10 16:30:47 2009 -0600

Commit:     Michael M Slusarz <slusarz@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/"),




03/10/2009 09:56:13 AM dom (dot) lalot (at) gmail (dot) com Comment #3
New Attachment: Invitation album photo.eml Download
Reply to this comment
Huh? Can you provide a full email example and use a bit more words?
Yes, here it is. You'll see that the link is broken. I changed some 
identity in the elm attached file.
03/09/2009 02:26:48 PM Chuck Hagenbuch Comment #2
State ⇒ Feedback
Reply to this comment
Huh? Can you provide a full email example and use a bit more words?
03/09/2009 07:33:52 AM dom (dot) lalot (at) gmail (dot) com Comment #1
Patch ⇒ No
State ⇒ Unconfirmed
Milestone ⇒
Queue ⇒ IMP
Summary ⇒ Incomplete parsing of Href link
Type ⇒ Bug
Priority ⇒ 1. Low
Reply to this comment
Hello,



Using picasaweb from google, the sent mail appears OK, but the link is 
not fully parsed. It stops just at target=, ignoring the rest of the 
link.



Dom





--00163630f4a1e3f3350464a2fe99

Content-Type: multipart/alternative; boundary=00163630f4a1e3f3320464a2fe98



--00163630f4a1e3f3320464a2fe98

Content-Type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes

Content-Transfer-Encoding: base64



Q2VzIHBob3RvcyBvbnQg6XTpIGVudm956WVzIGF2ZWMgUGljYXNhLCB1biBsb2dpY2llbCBkZSBH

b29nbGUuDQpQb3VyIGwnZXNzYXllciwgcmVuZGV6LXZvdXMgc3VyIDogaHR0cDovL3BpY2FzYS5n

b29nbGUuY29tLy4NCg0KaHR0cDovL3BpY2FzYXdlYi5nb29nbGUuZnIvbGgvc3JlZGlyP3VuYW1l

PWVyaWMubGFsb3QmdGFyZ2V0PUFMQlVNJmlkPTUzMTA5NDAxNTg5MzI3ODUwMjUmYXV0aGtleT1H

djFzUmdDUGlLdjdqY3JyeU0tQUUmYXV0aGtleT1HdjFzUmdDUGlLdjdqY3JyeU0tQUUmaW52aXRl

PUNQM0JyY1lNJmZlYXQ9ZW1haWwNCg==

--00163630f4a1e3f3320464a2fe98

Content-Type: text/html; charset=windows-1252

Content-Transfer-Encoding: quoted-printable



<body style=3D"font-family: Arial, Helvetica, sans-serif; background-color:=

white">

<!--a75c305b1c0a6022--><table border=3D0 cellpadding=3D0 
cellspacing=3D0 width=3D"600px">

<tr>

<td bgcolor=3D"#E1ECFF" width=3D"10px"></td>

<td width=3D"*" style=3D"border: 1px solid #ccc; padding: .6em .8em;">

<div style=3D"padding-bottom: .6em; font-weight: bold; font-size: 12pt; col=

or: #333;">Vous =EAtes invit=E9 =E0 voir l'album photo de Eric intitul=E9 :=

  <a href=3D'http://picasaweb.google.fr/lh/sredir?uname=3Deric.xxxxx&target=

=3DALBUM&id=3D5310940158932785025&authkey=3DGv1sRgCPiKv7jcrryM-AE&authkey=

=3DGv1sRgCPiKv7jcrryM-AE&invite=3DCP3BrcYM&feat=3Demail'>03-WaitakereRando<=

/a></div>

<div style=3D"background-color: #F5F5F5; border: 1px solid #CCC; padding: 0=

.8em;">

<!--a75c305b1c0a6022--><table cellspacing=3D0 cellpadding=3D0>

<tr>

<td valign=3D"top">

<div style=3D"border: 1px solid #ccc; padding: 7px; background-color: #FFF;=

">


Saved Queries