Printer-friendly version mangles some types of link
| Project: | Printer, e-mail and PDF versions |
| Version: | 6.x-1.10 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
The markdown module performs some mangling for mail addresses to make it (slightly) harder for a spammer to read the address.
If you enter this:
Here is an email address: <support@example.com>
You get this:
<span class='print-link'></span><p>Here is an email address: <a href="mailto:support@example.com">support@example.com</a></p>
And this works fine in a web browser.
However, view the printer-friendly version of the page, and the source becomes this:
<div class="print-content"><p>Here is an email address: <a href="https://download.nuix.com/%2526%2523109%3B%2526%252397%3B%2526%2523x69%3B%2526%2523x6c%3B%2526%2523x74%3B%2526%2523111%3B%2526%252358%3B%2526%2523115%3B%2526%2523x75%3B%2526%2523x70%3Bp%2526%2523111%3B%2526%2523114%3B%2526%2523x74%3B%2526%2523x40%3Be%2526%2523120%3B%2526%252397%3B%2526%2523x6d%3B%2526%2523x70%3B%2526%2523x6c%3B%2526%2523101%3B%2526%252346%3B%2526%2523x63%3B%2526%2523x6f%3B%2526%2523x6d%3B">support@example.com</a> <span class="print-footnote">[1]</span></p>
...
[1] https://download.nuix.com/%2526%2523109%3B%2526%252397%3B%2526%2523x69%3...
Basically the print module is performing an additional level of escaping, which is causing the URL to break as it is no longer a mailto: URL. I would expect this to break some other types of URL as well (anything containing character escapes which are already escaped), which is why I have titled this bug more generally.

#1
I can confirm this. A link with plusses in it gets translated to a link with spaces in it. For instance, "see+spot+run.pdf" becomes "see spot run.pdf".
The problem would seem to be the usage of urldecode() in print.pages.inc, for instance in the line:
$newurl = urldecode($url);.