View Issue Details

IDProjectCategoryView StatusLast Update
0007797phplist applicationStatisticspublic26-03-13 12:52
Reporterdpicon 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version2.11.7 
Target Version2.11.8Fixed in Version2.11.8 
Summary0007797: <area links do not work with CLICKTRACK.
DescriptionHi!

I found the link track does not work with area links.

Please read my following post for more info, and "fixing" code.

http://forums.phplist.com/viewtopic.php?t=6349

Thanks for PHPlist!
David.
TagsNo tags attached.

Relationships

related to 0002705 closed PHPList v2.11 release 
has duplicate 0006611 new Click tracking does not work with image maps 

Activities

h2b2

10-05-10 23:08

manager   ~0051003

related to http://forums.phplist.com/viewtopic.php?p=36971#p36971

duncanc

27-11-12 18:21

developer   ~0051922

The problem still exists in 2.10.x and 2.11.7 releases.

The cause is the regular expression used to match a elements, line 454 of file admin/sendemaillib.php for release 2.11.7

preg_match_all('/<a(.*)href=["\'](.*)["\']([^>]*)>(.*)<\/a>/Umis',$htmlmessage,$links);

The leading <a(.*) will match any element that begins with a, not just the a elements. In my case it was matching an area element and then the regex swallows everything up to the end of the next a element.

A solution is to match on white-space after the a

preg_match_all('/<a(\s+.*)href=["\'](.*)["\']([^>]*)>(.*)<\/a>/Umis',$htmlmessage,$links);

Tested and works.

michiel

27-11-12 20:26

manager   ~0051924


yes, or maybe just one space:

preg_match_all('/<aSPACE(.*)href

but your tests, do they make the AREAs trackable, or is the issue that AREA links get broken, and this won't break them?

michiel

26-03-13 12:52

manager   ~0051983

this will avoid the regex matching <area, which means that tracking <area is still something to deal with.