View Issue Details

IDProjectCategoryView StatusLast Update
0015275phplist applicationHTML Email Supportpublic03-05-10 18:16
Reportermcfang 
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
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.

Relationships

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

Activities

There are no notes attached to this issue.