From 68432ae641ff7869711ca9cbae8f0020bc742fd8 Mon Sep 17 00:00:00 2001 From: Gerhard Killesreiter Date: Mon, 27 Feb 2006 14:06:09 +0000 Subject: #49375, 'drupal_goto' / 'drupal_get_destination' broken with query params, patch by eberts --- includes/common.inc | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'includes') diff --git a/includes/common.inc b/includes/common.inc index 3a25c2dc8..99da0b592 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -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)); } } -- cgit v1.2.3