project_mail_output() in mail.inc currently mangles long URLs due to the order in which check_markup() is called.

The reason why is a little interesting. Here is what happens right now:
1. Basic text URLs with reference numbers are appended to the end of the mail body.
2. check_markup() converts those URLs to HTML links; if the link is too long it shortens the display version and adds an ellipsis (but the href attribute is still the original URL).
3. strip_tags() removes the HTML from the message and only keeps the shortened display version of the URL.

This patch re-orders the logic so that check_markup is called before the URL references are added.

Here is a test case that reminded me of this problem earlier today: <a href="http://cvs.drupal.org/viewvc.py/drupal/drupal/modules/node/node.module?r1=1.833&r2=1.834&pathrev=MAIN">test</a>

CommentFileSizeAuthor
issue_long_urls.patch974 bytesChrisKennedy

Comments

hunmonk’s picture

Status: Needs review » Fixed

tested, and it fixes the problem.

fixed in HEAD, 5.x-1.x, 4.7.x-2.x, 4.7.x-1.x.

thanks chris!

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

hunmonk’s picture

note that this patch was rolled back by #218959: [#issue_nid] filtered links do not appear as links in email -- see that issue for details.