Iframe module generates URL with invalid query string.
I am using following type of URL for the iframe
http://mydomain/content/phplist/?p=preferences&uid=b003b98749ba21ed87e32cf262ed03b4
The iframe module will encoded it, & becomes &, resulting in url:
http://mydomain/content/phplist/?p=preferences&uid=b003b98749ba21ed87e32cf262ed03b4
This is invalid. The PHP $_GET variable in the script opened in the iframe will not recognise "uid" as an attribute, instead it asumes "amp;uid" as being te attribute. There must not be any htmlentities (&) in the src url for an iframe.
My solution:
In iframe.module, at line 801, remove the check_url function.
So:
'<iframe src="' . check_url(url($path, $options)) . '"' . drupal_attributes($options['attributes']) .
Becomes:
'<iframe src="' . url($path, $options) . '"' . drupal_attributes($options['attributes']) .
The same goes for the link created in case a browser does not support iframes. Here html entities are alowed, but the l() function already uses check_url(), so when using check_url() again as parameter for the l() function creates a double-encoding which is not valid. Also here remove check_url().
My solution:
In iframe.module, at line 804, remove the check_url function.
So:
t('Your browser does not support iframes. But You can use the following link.') . ' ' . l('Link', check_url(url($path, $options)), $optionsLink) . '</iframe>';
Becomes
t('Your browser does not support iframes. But You can use the following link.') . ' ' . l('Link', url($path, $options), $optionsLink) . '</iframe>';
Comments
Comment #1
neffets commentedNo and Yes.
no: The uri in the iframe src attribute has to be valid html, so the ampersand has to be encoded.
==> there the check_url function is correct.
yes: In the alternate part its double encoded. Confirmed.
==> will change it to "l"-function alone, in the next release.
Comment #2
hovel commentedYou are absolutely right. My fault.
Comment #3
neffets commentedFixed in next release
Comment #5
neffets commentedfixed in revision 6.x-1.7
Comment #6
gilmorelou commentedHI, I 'm not sure I understand this....I need my iframe url to be:
http://www.signaturetravelnetwork.com/utils/landSearch/index.cfm?agency_id= 1580&utp=consumer&type=consumer
(at least that's what they gave us...)
and it gives me an error until I get rid of everything after the ? (including the ?)....
I need to have the agency id in there - this is a travel agent....
How can I get this to work?
thanks!
Comment #7
neffets commentedRemove the SPACE between "agency_id=" and the "1580", then it will be valid
Comment #8
neffets commented