#49375, 'drupal_goto' / 'drupal_get_destination' broken with query params, patch by eberts

4.7.x
Gerhard Killesreiter 2006-02-27 14:06:09 +00:00
parent 8ea7cb3f48
commit 68432ae641
1 changed files with 10 additions and 6 deletions

View File

@ -170,14 +170,18 @@ function drupal_get_destination() {
return 'destination='. urlencode($_REQUEST['destination']);
}
else {
$destination[] = $_GET['q'];
$params = array('page', 'sort', 'order');
foreach ($params as $param) {
if (isset($_GET[$param])) {
$destination[] = "$param=". $_GET[$param];
$path = $_GET['q'];
$params = array();
foreach ($_GET as $key => $value) {
if ($key == 'q') {
continue;
}
$params[] = urlencode($key) .'='. urlencode($value);
}
return 'destination='. urlencode(implode('&', $destination));
if (count($params)) {
$path .= '?';
}
return 'destination='. urlencode($path . implode('&', $params));
}
}