summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorGerhard Killesreiter <killes_www_drop_org@227.no-reply.drupal.org>2006-02-27 14:06:09 +0000
committerGerhard Killesreiter <killes_www_drop_org@227.no-reply.drupal.org>2006-02-27 14:06:09 +0000
commit68432ae641ff7869711ca9cbae8f0020bc742fd8 (patch)
tree4eaeb4edab679448d5a7ab67860f6d62be363973 /includes
parent8ea7cb3f484244fa8d3fd2f34848b460ba1e79b2 (diff)
downloadbrdo-68432ae641ff7869711ca9cbae8f0020bc742fd8.tar.gz
brdo-68432ae641ff7869711ca9cbae8f0020bc742fd8.tar.bz2
#49375, 'drupal_goto' / 'drupal_get_destination' broken with query params, patch by eberts
Diffstat (limited to 'includes')
-rw-r--r--includes/common.inc16
1 files changed, 10 insertions, 6 deletions
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));
}
}