Closed (duplicate)
Project:
CCK Redirection
Version:
5.x-1.0
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
27 Jun 2008 at 17:48 UTC
Updated:
28 Oct 2010 at 14:36 UTC
& characters in the URI are converted to & , thereby redirecting to a wrong destination than originally intended.
Comments
Comment #1
damienmckennaI fixed it by replacing:
with
Unless someone has another idea?
Comment #2
choster commentedMarked #352667: Changes charecters when submitted as a duplicate.
Comment #3
btopro commentedI change the _cck_redirection_divert function to account for node prepopulate urls. If you don't do this they won't complete correctly. It still does normal redirects correctly too.
function _cck_redirection_divert($element) {
//print $element['#item']['value'];
$url = $element['#item']['value'];
$urls = explode("&",$url,2);
drupal_goto($urls[0],$urls[1]);
}
This works in the 6.x version at least
Comment #4
greenbeans commentedI'm seeing a similar problem, but rather than HTML-encoding query strings, they're being URL-encoded, so that (for instance) a CiviCRM URL such as
http://example.com/civicrm/contribute/transact?reset=1&id=4
becomes:
http://example.com/civicrm/contribute/transact%3Freset%3D1%2526id%3D4
... which unsurprisingly results in an "access denied" error.
Is there any workaround for this?
Thanks.
Comment #5
btopro commentedThis problem still exists. My fix above works. This function needs to be changed to
function _cck_redirection_divert($element) {
if (!empty($element['#item']['value'])) {
$url = $element['#item']['value'];
$urls = explode("&",$url,2);
drupal_goto($urls[0],$urls[1]);
}
}
Comment #6
hopla commentedI made this patch (to version 5.x) in function cck_redirection_nodeapi:
It works and it's (IMHO) secure.
EDIT: forgot 'null' between $url and $query parameter
Comment #7
robin monks commentedThis is a duplicate of the work progressing over at Issue #593376. A solution there will solve both this issue, as well as other URL component problems.