Needs work
Project:
Link
Version:
7.x-1.1
Component:
Code
Priority:
Minor
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
29 Mar 2013 at 13:52 UTC
Updated:
10 Nov 2017 at 00:02 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
saitanay commentedHad the same issue.
A url link
http://example.com/uri?target=XXX:NOTICE:XX7809583:EN:HTMLwas being rendered as
http://example.com/uri?target=XXX%3ANOTICE%3XX7809583%3AEN%3AHTMLThe module uses core's url() to generate the link which seems to mandatorily encode all qureystrings (the parts of the url after =)
Attached is a patch that works around by decoding the urls back before rendering them.
Comment #2
amitgoyal commentedMinor issues,
- There is extra space at each of the line added in the patch.
- Space is needed after '//'.
Comment #3
saitanay commentedComment #4
saitanay commentedComment #5
Staxewing commentedHi, patch doesn't fix my problem with urls that contains colons. In a very practical way I found that if I reset the array $url_parts['url'] in _link_parse_url() function I solved the problem:
NO
$url_parts['url'] = $url;OK
$url_parts['url'] = "";Until now I had no further problem.
Comment #6
achapI had a similar problem. We were adding files and then copying the URL to a link field in a content type. The problem is that the link gets encoded twice so % gets converted into 25. E.g. %20 becomes %2520
The patch fixes the link destination, so the href goes back to having %20, however the title of the link (If you haven't specified one explicitly) still has broken encoding of %2520. However this doesn't affect the functionality of the link.
E.g. the href of sites.com/file%2520new.pdf becomes sites.com/files%20new.pdf but the title remains as sites.com/file%2520new.pdf
Comment #7
charles belovWorkaround for the %25 issue is to go to /admin/config/content/formats/plain_text and check Convert URLs into links. Downside is that if you don't want people entering URLs into plain text fields because they provide a sub-optimal experience/bad SEO, tough luck.