Commit 68432ae6 authored by Gerhard Killesreiter's avatar Gerhard Killesreiter

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

parent 8ea7cb3f
...@@ -170,14 +170,18 @@ function drupal_get_destination() { ...@@ -170,14 +170,18 @@ function drupal_get_destination() {
return 'destination='. urlencode($_REQUEST['destination']); return 'destination='. urlencode($_REQUEST['destination']);
} }
else { else {
$destination[] = $_GET['q']; $path = $_GET['q'];
$params = array('page', 'sort', 'order'); $params = array();
foreach ($params as $param) { foreach ($_GET as $key => $value) {
if (isset($_GET[$param])) { if ($key == 'q') {
$destination[] = "$param=". $_GET[$param]; continue;
} }
$params[] = urlencode($key) .'='. urlencode($value);
} }
return 'destination='. urlencode(implode('&', $destination)); if (count($params)) {
$path .= '?';
}
return 'destination='. urlencode($path . implode('&', $params));
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment