I have a page that's generated by a URL query with a "%26" in place of an ampersand. When the user clicks the "Printer-friendly version" link, they receive a blank page because the "%26" gets re-interpreted as "%2526" due to the drupal_urlencode() function that's called by the drupal_query_string_encode() function in line 341 of the print.module file.

Is there anyway this section of code can be re-written so that this "encoding of the encoded" doesn't happen?

Many thanks!

Comments

jcnventura’s picture

Status: Active » Fixed

Hi,

I have just committed the code that fixes this. It will be in the dev version soon.

João

chill5-0’s picture

Many thanks!

Anonymous’s picture

Status: Fixed » Closed (fixed)

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

fonant’s picture

I'm interested in this too, where I have user-submitted search data that appears in a query string, rather than in the main URL path (with clean URLs on).

The query string part of the URL should not use drupal_urlencode() as the double-encoding isn't needed to work around mod_rewrite's decoding of the main part of the URL. This function only appears to be called to encode the query-string part, never the entire URL.

Looks like this might have been broken way back in 2006: http://drupal.org/node/74070

Changing the call drupal_urlencode($value) to rawurlencode($value) towards the end of the drupal_query_string_encode() function works for me.

fonant’s picture

Status: Closed (fixed) » Active
jcnventura’s picture

Status: Active » Closed (fixed)