I am noticing there are similar issues involving query string parameters but not exactly what I'm facing. The main issue I see is that whenever I'm adding a link with a URL which includes a query string parameter (ie something beginning with ? and some more stuff) the problem is that ? is being url encoded unnecessarily and it's causing the link to 404 when clicked because I assume Drupal doesn't quite get that these are parameters and not something to be resolved to.
What I am noticing is that at around line 519 in the _link_sanitize function there is a call to the url() function which inside of that eventually calls drupal_encode_path. However when it comes time to display it via the link_default theme or similar it will also eventually call the l() function. Problem is within THAT l() function it will call url() again and also drupal_encode_path again. When you call drupal_encode_path twice on the same value it normally generates these % values for characters like ?, &, etc and that's going be problem when we're dealing with links.
Anyway that's what I've noticed for this issue. I created a patch which basically removes that call and does it the same way the live version does it.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | link-querystringencoded.patch | 1.03 KB | edward.radau |
Comments
Comment #2
edward.radau commentedAttaching my patch.
Comment #3
edward.radau commentedComment #4
edward.radau commentedNevermind the patch. It appears it reintroduces a bug which causes URLs with query string parameters to be truncated from display.
Comment #5
dgtlmoon commentedsee #1914072: Link Module displays malformed external URL