phplist

NOTE:: Before reporting an issue, make sure you are running the latest version, currently 3.3.1


View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0015275phplist applicationHTML Email Supportpublic04-05-09 13:1103-05-10 19:16
Reportermcfang 
PrioritynormalSeveritymajorReproducibilityalways
StatusresolvedResolutionfixed 
PlatformOSOS Version
Product Version2.10.9 
Target VersionFixed in Version2.10.10 
Summary0015275: stripHTML is too greedy when matching links
DescriptionIf your HTML has any A tags that do not have a HREF attribute then entire blocks of text are deleted.

A tags are most commonly used without HREF when providing anchor links within the content. eg: <a name="top"></a>

The problem is caused by a greedy match in function stripHTML (sendemaillib.php:1134)

$text = preg_replace("/<a.*href=[\"\'](.*)[\"\'][^>]*>(.*)<\/a>/Umis","[URLTEXT]\\2[ENDURLTEXT][LINK]\\1[ENDLINK]\n",$text);

If we replace the first greedy match with a saner match it will not be a problem:

$text = preg_replace("/<a[^>]*href=[\"\'](.*)[\"\'][^>]*>(.*)<\/a>/Umis","[URLTEXT]\\2[ENDURLTEXT][LINK]\\1[ENDLINK]\n",$text);
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
related to 0015193resolvedmichiel Portions of Content are Omitted in Plain Text from Plain Text Messages with <a> Tag 
related to 0009105resolvedmichiel Anchors in HTML get converted to links in text mails 

-  Notes
There are no notes attached to this issue.


Copyright © 2000 - 2017 MantisBT Team
Powered by Mantis Bugtracker