New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mantis 19555 - URL is truncated when click tracking is enabled #436

Merged
merged 1 commit into from Nov 13, 2018

Conversation

Projects
None yet
2 participants
@bramley
Contributor

bramley commented Nov 12, 2018

Ensure matching delimiter when processing href attribute in three places

  • finding links in an html format message for click tracking
  • finding links to add google tracking
  • converting an html format message to plain text

@bramley bramley changed the title from Mantsi 19555 - URL is truncated when click tracking is enabled to Mantis 19555 - URL is truncated when click tracking is enabled Nov 12, 2018

@michield

This comment has been minimized.

Member

michield commented Nov 13, 2018

Interesting. These regexes are hard to read, but you're saying that sometimes there may be a " inside a '-quoted href or the other way around, so that would match it badly?

Have you run tests on this? This seems a very unit-testable bit of code.

@bramley

This comment has been minimized.

Contributor

bramley commented Nov 13, 2018

I can add some details about what has been tested tomorrow but here is how the problem manifests itself. Using the original URL in this link
<a href="https://www.google.com/maps/place/Jack+Astor's+Bar+%26+Grill/@43.7345959,-79.3460459,17z/data=!3m2!4b1!5s0x89d4cd7216df3c6d:0xb43516d71ae89300!4m5!3m4!1s0x89d4cd717b796be3:0x54b68eeb1833e8b4!8m2!3d43.7345959!4d-79.3438572">link</a>

the URL in linktrack_forward is truncated at the single quote
image

and the link in the resultant email is badly formed. Note that the part of the original URL after the single quote is left in the link
<a href="https://www.dcameron.me.uk/lists/lt.php?tid=f0sGXVRUAQABCB9TBwcATlZTCFdPCAQFVxhSUQALB1lSUVAKB1xFU1UAC1UEAAhOBFBbBE8EDAdSGFUNCApOUwYECA4EBwxUAwBUSlBQCVtSVQ0ETwhUAFcYAAUGCk5ZBVMBFQYAXVJSWwQOUwoIAA" s+Bar+%26+Grill/@43.7345959,-79.3460459,17z/data=!3m2!4b1!5s0x89d4cd7216df3c6d:0xb43516d71ae89300!4m5!3m4!1s0x89d4cd717b796be3:0x54b68eeb1833e8b4!8m2!3d43.7345959!4d-79.3438572">link</a>

With the code change, the full URL is stored in the linktrack_forward table.
image

@michield

This comment has been minimized.

Member

michield commented Nov 13, 2018

That's good enough evidence for me :-)

might be interesting to tell Jack we squashed a bug because of his apostrophe ...

@michield michield merged commit 1a4d737 into phpList:master Nov 13, 2018

@bramley bramley deleted the bramley:Mantis_19555 branch Nov 15, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment