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.

CommentFileSizeAuthor
#2 link-querystringencoded.patch1.03 KBedward.radau

Comments

edward.radau created an issue. See original summary.

edward.radau’s picture

StatusFileSize
new1.03 KB

Attaching my patch.

edward.radau’s picture

Status: Active » Needs review
edward.radau’s picture

Nevermind the patch. It appears it reintroduces a bug which causes URLs with query string parameters to be truncated from display.

dgtlmoon’s picture

Status: Needs review » Closed (duplicate)