Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.992
diff -u -p -r1.992 common.inc
--- includes/common.inc	18 Sep 2009 10:54:20 -0000	1.992
+++ includes/common.inc	18 Sep 2009 23:48:03 -0000
@@ -317,6 +317,51 @@ function drupal_get_feeds($delimiter = "
  */
 
 /**
+ * Process a URL query parameter array to remove unwanted elements.
+ *
+ * @param $query
+ *   (optional) An array to be processed. Defaults to $_GET.
+ * @param $exclude
+ *   (optional) An list of $query array keys to remove. Use "parent[child]" to
+ *   exclude nested items. Defaults to array('q').
+ * @param $parent
+ *   Internal use only. Used to build the $query array key for nested items.
+ *
+ * @return
+ *   An array containing query parameters, which can used for url().
+ */
+function drupal_get_query_string(array $query = NULL, array $exclude = array('q'), $parent = '') {
+  // Set defaults, if none given.
+  if (!isset($query)) {
+    $query = $_GET;
+  }
+  // If $exclude is empty, there is nothing to filter.
+  if (empty($exclude)) {
+    return $query;
+  }
+
+  $params = array();
+  foreach ($query as $key => $value) {
+    $string_key = $key;
+    if ($parent) {
+      $string_key = $parent . '[' . $key . ']';
+    }
+    if (in_array($string_key, $exclude)) {
+      continue;
+    }
+
+    if (is_array($value)) {
+      $params[$key] = drupal_get_query_string($value, $exclude, $key);
+    }
+    else {
+      $params[$key] = $value;
+    }
+  }
+
+  return $params;
+}
+
+/**
  * Parse an array into a valid urlencoded query string.
  *
  * @param $query
@@ -327,9 +372,9 @@ function drupal_get_feeds($delimiter = "
  * @param $parent
  *   Should not be passed, only used in recursive calls.
  * @return
- *   An urlencoded string which can be appended to/as the URL query string.
+ *   A urlencoded string which can be appended to/as the URL query string.
  */
-function drupal_query_string_encode($query, $exclude = array(), $parent = '') {
+function drupal_query_string_encode(array $query, array $exclude = array(), $parent = '') {
   $params = array();
 
   foreach ($query as $key => $value) {
@@ -345,6 +390,10 @@ function drupal_query_string_encode($que
     if (is_array($value)) {
       $params[] = drupal_query_string_encode($value, $exclude, $key);
     }
+    // If a query parameter value is NULL, only append its key.
+    elseif (is_null($value)) {
+      $params[] = $key;
+    }
     else {
       $params[] = $key . '=' . rawurlencode($value);
     }
@@ -354,7 +403,7 @@ function drupal_query_string_encode($que
 }
 
 /**
- * Prepare a destination query string for use in combination with drupal_goto().
+ * Prepare a 'destination' URL query parameter for use in combination with drupal_goto().
  *
  * Used to direct the user back to the referring page after completing a form.
  * By default the current URL is returned. If a destination exists in the
@@ -365,7 +414,7 @@ function drupal_query_string_encode($que
  */
 function drupal_get_destination() {
   if (isset($_REQUEST['destination'])) {
-    return 'destination=' . urlencode($_REQUEST['destination']);
+    return array('destination' => $_REQUEST['destination']);
   }
   else {
     // Use $_GET here to retrieve the original path in source form.
@@ -374,7 +423,7 @@ function drupal_get_destination() {
     if ($query != '') {
       $path .= '?' . $query;
     }
-    return 'destination=' . urlencode($path);
+    return array('destination' => $path);
   }
 }
 
@@ -417,7 +466,7 @@ function drupal_get_destination() {
  *   supported.
  * @see drupal_get_destination()
  */
-function drupal_goto($path = '', $query = NULL, $fragment = NULL, $http_response_code = 302) {
+function drupal_goto($path = '', array $query = array(), $fragment = NULL, $http_response_code = 302) {
 
   if (isset($_REQUEST['destination'])) {
     extract(parse_url(urldecode($_REQUEST['destination'])));
@@ -2133,42 +2182,35 @@ function _format_date_callback(array $ma
  */
 
 /**
- * Generate a URL from a Drupal menu path. Will also pass-through existing URLs.
+ * Generate a URL.
  *
  * @param $path
- *   The Drupal path being linked to, such as "admin/content", or an
- *   existing URL like "http://drupal.org/". The special path
- *   '<front>' may also be given and will generate the site's base URL.
+ *   The Drupal path being linked to, such as "admin/content", or an existing
+ *   URL like "http://drupal.org/". The special path '<front>' may also be given
+ *   and will generate the site's base URL.
  * @param $options
  *   An associative array of additional options, with the following keys:
- *   - 'query'
- *       A URL-encoded query string to append to the link, or an array of query
- *       key/value-pairs without any URL-encoding.
- *   - 'fragment'
- *       A fragment identifier (or named anchor) to append to the link.
- *       Do not include the '#' character.
- *   - 'absolute' (default FALSE)
- *       Whether to force the output to be an absolute link (beginning with
- *       http:). Useful for links that will be displayed outside the site, such
- *       as in an RSS feed.
- *   - 'alias' (default FALSE)
- *       Whether the given path is an alias already.
- *   - 'external'
- *       Whether the given path is an external URL.
- *   - 'language'
- *       An optional language object. Used to build the URL to link to and
- *       look up the proper alias for the link.
- *   - 'https'
- *       Whether this URL should point to a secure location. If not specified,
- *       the current scheme is used, so the user stays on http or https
- *       respectively. TRUE enforces HTTPS and FALSE enforces HTTP, but HTTPS
- *       can only be enforced when the variable 'https' is set to TRUE.
- *   - 'base_url'
- *       Only used internally, to modify the base URL when a language dependent
- *       URL requires so.
- *   - 'prefix'
- *       Only used internally, to modify the path when a language dependent URL
- *       requires so.
+ *   - 'query': An array of query key/value-pairs (without any URL-encoding) to
+ *     append to the link.
+ *   - 'fragment': A fragment identifier (or named anchor) to append to the
+ *     link. Do not include the leading '#' character.
+ *   - 'absolute': Defaults to FALSE. Whether to force the output to be an
+ *     absolute link (beginning with http:). Useful for links that will be
+ *     displayed outside the site, such as in a RSS feed.
+ *   - 'alias': Defaults to FALSE. Whether the given path is a URL alias
+ *     already.
+ *   - 'external': Whether the given path is an external URL.
+ *   - 'language': An optional language object. Used to build the URL to link to
+ *     and look up the proper alias for the link.
+ *   - 'https': Whether this URL should point to a secure location. If not
+ *     specified, the current scheme is used, so the user stays on http or https
+ *     respectively. TRUE enforces HTTPS and FALSE enforces HTTP, but HTTPS can
+ *     only be enforced when the variable 'https' is set to TRUE.
+ *   - 'base_url': Only used internally, to modify the base URL when a language
+ *     dependent URL requires so.
+ *   - 'prefix': Only used internally, to modify the path when a language
+ *     dependent URL requires so.
+ *
  * @return
  *   A string containing a URL to the given path.
  *
@@ -2179,7 +2221,7 @@ function url($path = NULL, array $option
   // Merge in defaults.
   $options += array(
     'fragment' => '',
-    'query' => '',
+    'query' => array(),
     'absolute' => FALSE,
     'alias' => FALSE,
     'https' => FALSE,
@@ -2200,21 +2242,19 @@ function url($path = NULL, array $option
   if ($options['fragment']) {
     $options['fragment'] = '#' . $options['fragment'];
   }
-  if (is_array($options['query'])) {
-    $options['query'] = drupal_query_string_encode($options['query']);
-  }
 
   if ($options['external']) {
     // Split off the fragment.
     if (strpos($path, '#') !== FALSE) {
       list($path, $old_fragment) = explode('#', $path, 2);
+      // If $options contains no fragment, take it over from the path.
       if (isset($old_fragment) && !$options['fragment']) {
         $options['fragment'] = '#' . $old_fragment;
       }
     }
     // Append the query.
     if ($options['query']) {
-      $path .= (strpos($path, '?') !== FALSE ? '&' : '?') . $options['query'];
+      $path .= (strpos($path, '?') !== FALSE ? '&' : '?') . drupal_query_string_encode($options['query']);
     }
     // Reassemble.
     return $path . $options['fragment'];
@@ -2267,25 +2307,25 @@ function url($path = NULL, array $option
   $prefix = empty($path) ? rtrim($options['prefix'], '/') : $options['prefix'];
   $path = drupal_encode_path($prefix . $path);
 
-  if (variable_get('clean_url', '0')) {
-    // With Clean URLs.
+  // With Clean URLs.
+  if (variable_get('clean_url', 0)) {
     if ($options['query']) {
-      return $base . $path . '?' . $options['query'] . $options['fragment'];
+      return $base . $path . '?' . drupal_query_string_encode($options['query']) . $options['fragment'];
     }
     else {
       return $base . $path . $options['fragment'];
     }
   }
+  // Without Clean URLs.
   else {
-    // Without Clean URLs.
-    $variables = array();
+    $query = array();
     if (!empty($path)) {
-      $variables[] = 'q=' . $path;
+      $query[] = 'q=' . $path;
     }
-    if (!empty($options['query'])) {
-      $variables[] = $options['query'];
+    if ($options['query']) {
+      $query[] = drupal_query_string_encode($options['query']);
     }
-    if ($query = join('&', $variables)) {
+    if ($query = implode('&', $query)) {
       return $base . $script . '?' . $query . $options['fragment'];
     }
     else {
Index: includes/form.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/form.inc,v
retrieving revision 1.373
diff -u -p -r1.373 form.inc
--- includes/form.inc	18 Sep 2009 00:12:45 -0000	1.373
+++ includes/form.inc	18 Sep 2009 17:18:17 -0000
@@ -2956,7 +2956,7 @@ function batch_process($redirect = NULL,
       // Set the batch number in the session to guarantee that it will stay alive.
       $_SESSION['batches'][$batch['id']] = TRUE;
 
-      drupal_goto($batch['url'], 'op=start&id=' . $batch['id']);
+      drupal_goto($batch['url'], array('op' => 'start', 'id' => $batch['id']));
     }
     else {
       // Non-progressive execution: bypass the whole progressbar workflow
Index: includes/pager.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/pager.inc,v
retrieving revision 1.72
diff -u -p -r1.72 pager.inc
--- includes/pager.inc	18 Sep 2009 00:04:21 -0000	1.72
+++ includes/pager.inc	18 Sep 2009 23:48:23 -0000
@@ -171,18 +171,18 @@ class PagerDefault extends SelectQueryEx
 }
 
 /**
- * Compose a query string to append to pager requests.
+ * Compose a URL query parameter array to append to pager links.
  *
  * @return
- *   A query string that consists of all components of the current page request
- *   except for those pertaining to paging.
+ *   A URL query parameter array that consists of all components of the current
+ *   page request except for those pertaining to paging.
  */
-function pager_get_querystring() {
-  static $string = NULL;
-  if (!isset($string)) {
-    $string = drupal_query_string_encode($_REQUEST, array_merge(array('q', 'page'), array_keys($_COOKIE)));
+function pager_get_query_string() {
+  $query = &drupal_static(__FUNCTION__);
+  if (!isset($query)) {
+    $query = drupal_get_query_string($_REQUEST, array_merge(array('q', 'page'), array_keys($_COOKIE)));
   }
-  return $string;
+  return $query;
 }
 
 /**
@@ -465,11 +465,10 @@ function theme_pager_link($text, $page_n
 
   $query = array();
   if (count($parameters)) {
-    $query[] = drupal_query_string_encode($parameters, array());
+    $query = drupal_get_query_string($parameters, array());
   }
-  $querystring = pager_get_querystring();
-  if ($querystring != '') {
-    $query[] = $querystring;
+  if ($querystring = pager_get_query_string()) {
+    $query = array_merge($query, $querystring);
   }
 
   // Set each pager link title
@@ -491,7 +490,7 @@ function theme_pager_link($text, $page_n
     }
   }
 
-  return l($text, $_GET['q'], array('attributes' => $attributes, 'query' => count($query) ? implode('&', $query) : NULL));
+  return l($text, $_GET['q'], array('attributes' => $attributes, 'query' => $query));
 }
 
 /**
Index: includes/tablesort.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/tablesort.inc,v
retrieving revision 1.54
diff -u -p -r1.54 tablesort.inc
--- includes/tablesort.inc	18 Sep 2009 00:04:21 -0000	1.54
+++ includes/tablesort.inc	18 Sep 2009 23:48:49 -0000
@@ -59,7 +59,7 @@ class TableSort extends SelectQueryExten
   protected function init() {
     $ts = $this->order();
     $ts['sort'] = $this->getSort();
-    $ts['query_string'] = $this->getQueryString();
+    $ts['query'] = $this->getQueryString();
     return $ts;
   }
 
@@ -87,14 +87,16 @@ class TableSort extends SelectQueryExten
   }
 
   /**
-   * Compose a query string to append to table sorting requests.
+   * Compose a URL query parameter array to append to table sorting requests.
    *
    * @return
-   *   A query string that consists of all components of the current page request
-   *   except for those pertaining to table sorting.
+   *   A URL query parameter array that consists of all components of the current
+   *   page request except for those pertaining to table sorting.
+   *
+   * @see tablesort_get_query_string()
    */
   protected function getQueryString() {
-    return drupal_query_string_encode($_REQUEST, array_merge(array('q', 'sort', 'order'), array_keys($_COOKIE)));
+    return tablesort_get_query_string();
   }
 
   /**
@@ -141,7 +143,7 @@ class TableSort extends SelectQueryExten
 function tablesort_init($header) {
   $ts = tablesort_get_order($header);
   $ts['sort'] = tablesort_get_sort($header);
-  $ts['query_string'] = tablesort_get_querystring();
+  $ts['query'] = tablesort_get_query_string();
   return $ts;
 }
 
@@ -174,11 +176,7 @@ function tablesort_header($cell, $header
       $ts['sort'] = 'asc';
       $image = '';
     }
-
-    if (!empty($ts['query_string'])) {
-      $ts['query_string'] = '&' . $ts['query_string'];
-    }
-    $cell['data'] = l($cell['data'] . $image, $_GET['q'], array('attributes' => array('title' => $title), 'query' => 'sort=' . $ts['sort'] . '&order=' . urlencode($cell['data']) . $ts['query_string'], 'html' => TRUE));
+    $cell['data'] = l($cell['data'] . $image, $_GET['q'], array('attributes' => array('title' => $title), 'query' => array_merge(array('sort' => $ts['sort'], 'order' => $cell['data']), $ts['query']), 'html' => TRUE));
 
     unset($cell['field'], $cell['sort']);
   }
@@ -214,14 +212,14 @@ function tablesort_cell($cell, $header, 
 }
 
 /**
- * Compose a query string to append to table sorting requests.
+ * Compose a URL query parameter array to append to table sorting requests.
  *
  * @return
- *   A query string that consists of all components of the current page request
- *   except for those pertaining to table sorting.
+ *   A URL query parameter array that consists of all components of the current
+ *   page request except for those pertaining to table sorting.
  */
-function tablesort_get_querystring() {
-  return drupal_query_string_encode($_REQUEST, array_merge(array('q', 'sort', 'order'), array_keys($_COOKIE)));
+function tablesort_get_query_string() {
+  return drupal_get_query_string($_REQUEST, array_merge(array('q', 'sort', 'order'), array_keys($_COOKIE)));
 }
 
 /**
Index: modules/aggregator/aggregator.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/aggregator/aggregator.test,v
retrieving revision 1.32
diff -u -p -r1.32 aggregator.test
--- modules/aggregator/aggregator.test	18 Sep 2009 00:12:45 -0000	1.32
+++ modules/aggregator/aggregator.test	18 Sep 2009 17:18:17 -0000
@@ -56,7 +56,7 @@ class AggregatorTestCase extends DrupalW
     $feed_name = $this->randomName(10);
     if (!$feed_url) {
       $feed_url = url('rss.xml', array(
-        'query' => 'feed=' . $feed_name,
+        'query' => array('feed' => $feed_name),
         'absolute' => TRUE,
       ));
     }
Index: modules/book/book.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/book/book.module,v
retrieving revision 1.514
diff -u -p -r1.514 book.module
--- modules/book/book.module	18 Sep 2009 10:54:20 -0000	1.514
+++ modules/book/book.module	18 Sep 2009 17:18:17 -0000
@@ -73,7 +73,7 @@ function book_node_view_link($node, $bui
         $links['book_add_child'] = array(
           'title' => t('Add child page'),
           'href' => 'node/add/' . str_replace('_', '-', $child_type),
-          'query' => 'parent=' . $node->book['mlid'],
+          'query' => array('parent' => $node->book['mlid']),
         );
       }
 
Index: modules/comment/comment.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.module,v
retrieving revision 1.771
diff -u -p -r1.771 comment.module
--- modules/comment/comment.module	18 Sep 2009 00:12:45 -0000	1.771
+++ modules/comment/comment.module	18 Sep 2009 17:18:17 -0000
@@ -445,7 +445,7 @@ function comment_new_page_count($num_com
   }
 
   if ($pageno >= 1) {
-    $pagenum = "page=" . intval($pageno);
+    $pagenum = array('page' => intval($pageno));
   }
 
   return $pagenum;
@@ -2148,10 +2148,10 @@ function theme_comment_post_forbidden($n
       // We cannot use drupal_get_destination() because these links
       // sometimes appear on /node and taxonomy listing pages.
       if (variable_get('comment_form_location_' . $node->type, COMMENT_FORM_BELOW) == COMMENT_FORM_SEPARATE_PAGE) {
-        $destination = 'destination=' . rawurlencode("comment/reply/$node->nid#comment-form");
+        $destination = array('destination', "comment/reply/$node->nid#comment-form");
       }
       else {
-        $destination = 'destination=' . rawurlencode("node/$node->nid#comment-form");
+        $destination = array('destination', "node/$node->nid#comment-form");
       }
 
       if (variable_get('user_register', 1)) {
Index: modules/comment/comment.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.test,v
retrieving revision 1.44
diff -u -p -r1.44 comment.test
--- modules/comment/comment.test	21 Aug 2009 14:27:44 -0000	1.44
+++ modules/comment/comment.test	18 Sep 2009 17:18:17 -0000
@@ -308,7 +308,7 @@ class CommentInterfaceTest extends Comme
     $this->setCommentsPerPage(2);
     $comment_new_page = $this->postComment($this->node, $this->randomName(), $this->randomName(), TRUE);
     $this->assertTrue($this->commentExists($comment_new_page), t('Page one exists. %s'));
-    $this->drupalGet('node/' . $this->node->nid, array('query' => 'page=1'));
+    $this->drupalGet('node/' . $this->node->nid, array('query' => array('page' => 1)));
     $this->assertTrue($this->commentExists($reply, TRUE), t('Page two exists. %s'));
     $this->setCommentsPerPage(50);
 
@@ -588,13 +588,13 @@ class CommentPagerTest extends CommentHe
     $this->assertFalse($this->commentExists($comments[2]), t('Comment 3 does not appear on page 1.'));
 
     // Check the second page.
-    $this->drupalGet('node/' . $node->nid, array('query' => 'page=1'));
+    $this->drupalGet('node/' . $node->nid, array('query' => array('page' => 1)));
     $this->assertTrue($this->commentExists($comments[1]), t('Comment 2 appears on page 2.'));
     $this->assertFalse($this->commentExists($comments[0]), t('Comment 1 does not appear on page 2.'));
     $this->assertFalse($this->commentExists($comments[2]), t('Comment 3 does not appear on page 2.'));
 
     // Check the third page.
-    $this->drupalGet('node/' . $node->nid, array('query' => 'page=2'));
+    $this->drupalGet('node/' . $node->nid, array('query' => array('page' => 2)));
     $this->assertTrue($this->commentExists($comments[2]), t('Comment 3 appears on page 3.'));
     $this->assertFalse($this->commentExists($comments[0]), t('Comment 1 does not appear on page 3.'));
     $this->assertFalse($this->commentExists($comments[1]), t('Comment 2 does not appear on page 3.'));
@@ -608,21 +608,21 @@ class CommentPagerTest extends CommentHe
     $this->setCommentsPerPage(2);
     // We are still in flat view - the replies should not be on the first page,
     // even though they are replies to the oldest comment.
-    $this->drupalGet('node/' . $node->nid, array('query' => 'page=0'));
+    $this->drupalGet('node/' . $node->nid, array('query' => array('page' => 0)));
     $this->assertFalse($this->commentExists($reply, TRUE), t('In flat mode, reply does not appear on page 1.'));
 
     // If we switch to threaded mode, the replies on the oldest comment
     // should be bumped to the first page and comment 6 should be bumped
     // to the second page.
     $this->setCommentSettings('comment_default_mode', COMMENT_MODE_THREADED, t('Switched to threaded mode.'));
-    $this->drupalGet('node/' . $node->nid, array('query' => 'page=0'));
+    $this->drupalGet('node/' . $node->nid, array('query' => array('page' => 0)));
     $this->assertTrue($this->commentExists($reply, TRUE), t('In threaded mode, reply appears on page 1.'));
     $this->assertFalse($this->commentExists($comments[1]), t('In threaded mode, comment 2 has been bumped off of page 1.'));
 
     // If (# replies > # comments per page) in threaded expanded view,
     // the overage should be bumped.
     $reply2 = $this->postComment(NULL, $this->randomName(), $this->randomName(), FALSE, TRUE);
-    $this->drupalGet('node/' . $node->nid, array('query' => 'page=0'));
+    $this->drupalGet('node/' . $node->nid, array('query' => array('page' => 0)));
     $this->assertFalse($this->commentExists($reply2, TRUE), t('In threaded mode where # replies > # comments per page, the newest reply does not appear on page 1.'));
 
     $this->drupalLogout();
Index: modules/contact/contact.pages.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/contact/contact.pages.inc,v
retrieving revision 1.24
diff -u -p -r1.24 contact.pages.inc
--- modules/contact/contact.pages.inc	18 Sep 2009 00:12:46 -0000	1.24
+++ modules/contact/contact.pages.inc	18 Sep 2009 17:18:17 -0000
@@ -155,7 +155,7 @@ function contact_personal_page($account)
   global $user;
 
   if (!valid_email_address($user->mail)) {
-    $output = t('You need to provide a valid e-mail address to contact other users. Please update your <a href="@url">user information</a> and try again.', array('@url' => url("user/$user->uid/edit", array('query' => 'destination=' . drupal_get_destination()))));
+    $output = t('You need to provide a valid e-mail address to contact other users. Please update your <a href="@url">user information</a> and try again.', array('@url' => url("user/$user->uid/edit", array('query' => drupal_get_destination()))));
   }
   elseif (!flood_is_allowed('contact', variable_get('contact_hourly_threshold', 3)) && !user_access('administer site-wide contact form')) {
     $output = t("You cannot send more than %number messages per hour. Please try again later.", array('%number' => variable_get('contact_hourly_threshold', 3)));
Index: modules/field_ui/field_ui.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/field_ui/field_ui.admin.inc,v
retrieving revision 1.15
diff -u -p -r1.15 field_ui.admin.inc
--- modules/field_ui/field_ui.admin.inc	18 Sep 2009 00:12:46 -0000	1.15
+++ modules/field_ui/field_ui.admin.inc	18 Sep 2009 17:18:17 -0000
@@ -539,7 +539,8 @@ function field_ui_field_overview_form_su
   }
 
   if ($destinations) {
-    $destinations[] = urldecode(substr(drupal_get_destination(), 12));
+    $destination = drupal_get_destination();
+    $destinations[] = urldecode($destination['destination']);
     unset($_REQUEST['destination']);
     $form_state['redirect'] = field_ui_get_destinations($destinations);
   }
Index: modules/node/node.pages.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.pages.inc,v
retrieving revision 1.80
diff -u -p -r1.80 node.pages.inc
--- modules/node/node.pages.inc	18 Sep 2009 00:12:47 -0000	1.80
+++ modules/node/node.pages.inc	18 Sep 2009 17:18:17 -0000
@@ -300,7 +300,7 @@ function node_form($form, &$form_state, 
  * Button submit function: handle the 'Delete' button on the node form.
  */
 function node_form_delete_submit($form, &$form_state) {
-  $destination = '';
+  $destination = array();
   if (isset($_REQUEST['destination'])) {
     $destination = drupal_get_destination();
     unset($_REQUEST['destination']);
Index: modules/openid/tests/openid_test.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/openid/tests/openid_test.module,v
retrieving revision 1.3
diff -u -p -r1.3 openid_test.module
--- modules/openid/tests/openid_test.module	10 Jun 2009 20:13:20 -0000	1.3
+++ modules/openid/tests/openid_test.module	18 Sep 2009 17:18:17 -0000
@@ -229,5 +229,5 @@ function _openid_test_endpoint_authentic
   // Put the signed message into the query string of a URL supplied by the
   // Relying Party, and redirect the user.
   drupal_set_header('Content-Type', 'text/plain');
-  header('Location: ' . url($_REQUEST['openid_return_to'], array('query' => http_build_query($response, '', '&'), 'external' => TRUE)));
+  header('Location: ' . url($_REQUEST['openid_return_to'], array('query' => $response, 'external' => TRUE)));
 }
Index: modules/search/search.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/search/search.test,v
retrieving revision 1.35
diff -u -p -r1.35 search.test
--- modules/search/search.test	11 Sep 2009 15:39:48 -0000	1.35
+++ modules/search/search.test	18 Sep 2009 17:18:17 -0000
@@ -499,7 +499,7 @@ class SearchCommentTestCase extends Drup
 
     // Invoke search index update.
     $this->drupalLogout();
-    $this->drupalGet($GLOBALS['base_url'] . '/cron.php', array('external' => TRUE, 'query' => 'cron_key=' . variable_get('cron_key', 'drupal')));
+    $this->drupalGet($GLOBALS['base_url'] . '/cron.php', array('external' => TRUE, 'query' => array('cron_key' => variable_get('cron_key', 'drupal'))));
 
     // Search for $title.
     $edit = array(
@@ -521,7 +521,7 @@ class SearchCommentTestCase extends Drup
 
     // Invoke search index update.
     $this->drupalLogout();
-    $this->drupalGet($GLOBALS['base_url'] . '/cron.php', array('external' => TRUE, 'query' => 'cron_key=' . variable_get('cron_key', 'drupal')));
+    $this->drupalGet($GLOBALS['base_url'] . '/cron.php', array('external' => TRUE, 'query' => array('cron_key' => variable_get('cron_key', 'drupal'))));
 
     // Search for $title.
     $this->drupalPost('', $edit, t('Search'));
Index: modules/simpletest/drupal_web_test_case.php
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/drupal_web_test_case.php,v
retrieving revision 1.149
diff -u -p -r1.149 drupal_web_test_case.php
--- modules/simpletest/drupal_web_test_case.php	17 Sep 2009 03:12:41 -0000	1.149
+++ modules/simpletest/drupal_web_test_case.php	18 Sep 2009 17:18:17 -0000
@@ -1003,7 +1003,7 @@ class DrupalWebTestCase extends DrupalTe
     // Make a request to the logout page, and redirect to the user page, the
     // idea being if you were properly logged out you should be seeing a login
     // screen.
-    $this->drupalGet('user/logout', array('query' => 'destination=user'));
+    $this->drupalGet('user/logout', array('query' => array('destination' => 'user')));
     $pass = $this->assertField('name', t('Username field found.'), t('Logout'));
     $pass = $pass && $this->assertField('pass', t('Password field found.'), t('Logout'));
 
@@ -1804,7 +1804,7 @@ class DrupalWebTestCase extends DrupalTe
         $path = substr($path, $n);
       }
       if (isset($parts['query'])) {
-        $options['query'] = $parts['query'];
+        parse_str($parts['query'], $options['query']);
       }
       $path = url($path, $options);
     }
Index: modules/simpletest/tests/browser_test.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/browser_test.module,v
retrieving revision 1.2
diff -u -p -r1.2 browser_test.module
--- modules/simpletest/tests/browser_test.module	18 Sep 2009 00:12:47 -0000	1.2
+++ modules/simpletest/tests/browser_test.module	18 Sep 2009 17:18:17 -0000
@@ -58,7 +58,7 @@ function browser_test_print_post_form_su
 
 function browser_test_refresh_meta() {
   if (!isset($_GET['refresh'])) {
-    $url = url('browser_test/refresh/meta', array('absolute' => TRUE, 'query' => 'refresh=true'));
+    $url = url('browser_test/refresh/meta', array('absolute' => TRUE, 'query' => array('refresh' => 'true')));
     drupal_add_html_head('<meta http-equiv="Refresh" content="0; URL=' . $url . '">');
     return '';
   }
@@ -68,7 +68,7 @@ function browser_test_refresh_meta() {
 
 function browser_test_refresh_header() {
   if (!isset($_GET['refresh'])) {
-    $url = url('browser_test/refresh/header', array('absolute' => TRUE, 'query' => 'refresh=true'));
+    $url = url('browser_test/refresh/header', array('absolute' => TRUE, 'query' => array('refresh' => 'true')));
     drupal_set_header('Location', $url);
     return '';
   }
Index: modules/simpletest/tests/common.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/common.test,v
retrieving revision 1.72
diff -u -p -r1.72 common.test
--- modules/simpletest/tests/common.test	16 Sep 2009 15:28:00 -0000	1.72
+++ modules/simpletest/tests/common.test	18 Sep 2009 23:35:51 -0000
@@ -2,10 +2,9 @@
 // $Id: common.test,v 1.72 2009/09/16 15:28:00 webchick Exp $
 
 /**
- * Tests for the l() function.
+ * Tests for URL generation functions.
  */
-class CommonLUnitTest extends DrupalUnitTestCase {
-
+class CommonURLUnitTest extends DrupalUnitTestCase {
   public static function getInfo() {
     return array(
       'name' => 'URL generation tests',
@@ -34,40 +33,115 @@ class CommonLUnitTest extends DrupalUnit
      $this->assertEqual(drupal_query_string_encode(array('a' => '1', 'b' => '2', 'c' => '3'), array('b')), 'a=1&c=3', t('Value was properly excluded.'));
      $this->assertEqual(drupal_query_string_encode(array('a' => array('b' => '2', 'c' => '3')), array('b', 'a[c]')), 'a[b]=2', t('Nested array was properly encoded.'));
    }
-   
+
   /**
    * Test url() with/without query, with/without fragment, absolute on/off and
    * assert all that works when clean URLs are on and off.
    */
   function testUrl() {
     global $base_url;
-    
+
     foreach (array(FALSE, TRUE) as $absolute) {
       // Get the expected start of the path string.
       $base = $absolute ? $base_url . '/' : base_path();
       $absolute_string = $absolute ? 'absolute' : NULL;
-      
-      // Run tests with clean urls disabled.
+
+      // Disable Clean URLs.
       $GLOBALS['conf']['clean_url'] = 0;
       $clean_urls = 'disabled';
-      
-      $this->assertTrue(url('node', array('absolute' => $absolute)) == $base . '?q=node', t('Creation of @absolute internal url with clean urls @clean_urls.', array('@absolute' => $absolute_string, '@clean_urls' => $clean_urls)));
-      $this->assertTrue(url('node', array('fragment' => 'foo', 'absolute' => $absolute)) == $base . '?q=node#foo', t('Creation of @absolute internal url with fragment option with clean urls @clean_urls.', array('@absolute' => $absolute_string, '@clean_urls' => $clean_urls)));
-      $this->assertTrue(url('node', array('query' => 'foo', 'absolute' => $absolute)) == $base . '?q=node&foo', t('Creation of @absolute internal url with query option with clean urls @clean_urls.', array('@absolute' => $absolute_string, '@clean_urls' => $clean_urls)));
-      $this->assertTrue(url('node', array('query' => 'foo', 'fragment' => 'bar', 'absolute' => $absolute)) == $base . '?q=node&foo#bar', t('Creation of @absolute internal url with query and fragment option with clean urls @clean_urls.', array('@absolute' => $absolute_string, '@clean_urls' => $clean_urls)));
-      $this->assertTrue(url('<front>', array('absolute' => $absolute)) == $base, t('Creation of @absolute internal url using front with clean urls @clean_urls.', array('@absolute' => $absolute_string, '@clean_urls' => $clean_urls)));
-  
-      // Run tests again with clean urls enabled.
+
+      $t_args = array('@absolute' => $absolute_string, '@clean_urls' => $clean_urls);
+
+      $url = $base . '?q=node/123';
+      $result = url('node/123', array('absolute' => $absolute));
+      $this->assertEqual($url, $result, t('Creation of @absolute internal url with clean urls @clean_urls.', $t_args));
+
+      $url = $base . '?q=node/123#foo';
+      $result = url('node/123', array('fragment' => 'foo', 'absolute' => $absolute));
+      $this->assertEqual($url, $result, t('Creation of @absolute internal url with fragment option with clean urls @clean_urls.', $t_args));
+
+      $url = $base . '?q=node/123&foo';
+      $result = url('node/123', array('query' => array('foo' => NULL), 'absolute' => $absolute));
+      $this->assertEqual($url, $result, t('Creation of @absolute internal url with query option with clean urls @clean_urls.', $t_args));
+
+      $url = $base . '?q=node/123&foo=bar&bar=baz';
+      $result = url('node/123', array('query' => array('foo' => 'bar', 'bar' => 'baz'), 'absolute' => $absolute));
+      $this->assertEqual($url, $result, t('Creation of @absolute internal url with query option with clean urls @clean_urls.', $t_args));
+
+      $url = $base . '?q=node/123&foo#bar';
+      $result = url('node/123', array('query' => array('foo' => NULL), 'fragment' => 'bar', 'absolute' => $absolute));
+      $this->assertEqual($url, $result, t('Creation of @absolute internal url with query and fragment option with clean urls @clean_urls.', $t_args));
+
+      $url = $base;
+      $result = url('<front>', array('absolute' => $absolute));
+      $this->assertEqual($url, $result, t('Creation of @absolute internal url using front with clean urls @clean_urls.', $t_args));
+
+      // Enable Clean URLs.
       $GLOBALS['conf']['clean_url'] = 1;
       $clean_urls = 'enabled';
-      
-      $this->assertTrue(url('node', array('absolute' => $absolute)) == $base . 'node', t('Creation of @absolute internal url with clean urls @clean_urls.', array('@absolute' => $absolute_string, '@clean_urls' => $clean_urls)));
-      $this->assertTrue(url('node', array('fragment' => 'foo', 'absolute' => $absolute)) == $base . 'node#foo', t('Creation of @absolute internal url with fragment option with clean urls @clean_urls.', array('@absolute' => $absolute_string, '@clean_urls' => $clean_urls)));
-      $this->assertTrue(url('node', array('query' => 'foo', 'absolute' => $absolute)) == $base . 'node?foo', t('Creation of @absolute internal url with query option with clean urls @clean_urls.', array('@absolute' => $absolute_string, '@clean_urls' => $clean_urls)));
-      $this->assertTrue(url('node', array('query' => 'foo', 'fragment' => 'bar', 'absolute' => $absolute)) == $base . 'node?foo#bar', t('Creation of @absolute internal url with query and fragment option with clean urls @clean_urls.', array('@absolute' => $absolute_string, '@clean_urls' => $clean_urls)));
-      $this->assertTrue(url('<front>', array('absolute' => $absolute)) == $base, t('Creation of @absolute internal url using front with clean urls @clean_urls', array('@absolute' => $absolute_string, '@clean_urls' => $clean_urls)));
+
+      $t_args = array('@absolute' => $absolute_string, '@clean_urls' => $clean_urls);
+
+      $url = $base . 'node/123';
+      $result = url('node/123', array('absolute' => $absolute));
+      $this->assertEqual($url, $result, t('Creation of @absolute internal url with clean urls @clean_urls.', $t_args));
+
+      $url = $base . 'node/123#foo';
+      $result = url('node/123', array('fragment' => 'foo', 'absolute' => $absolute));
+      $this->assertEqual($url, $result, t('Creation of @absolute internal url with fragment option with clean urls @clean_urls.', $t_args));
+
+      $url = $base . 'node/123?foo';
+      $result = url('node/123', array('query' => array('foo' => NULL), 'absolute' => $absolute));
+      $this->assertEqual($url, $result, t('Creation of @absolute internal url with query option with clean urls @clean_urls.', $t_args));
+
+      $url = $base . 'node/123?foo=bar&bar=baz';
+      $result = url('node/123', array('query' => array('foo' => 'bar', 'bar' => 'baz'), 'absolute' => $absolute));
+      $this->assertEqual($url, $result, t('Creation of @absolute internal url with query option with clean urls @clean_urls.', $t_args));
+
+      $url = $base . 'node/123?foo#bar';
+      $result = url('node/123', array('query' => array('foo' => NULL), 'fragment' => 'bar', 'absolute' => $absolute));
+      $this->assertEqual($url, $result, t('Creation of @absolute internal url with query and fragment option with clean urls @clean_urls.', $t_args));
+
+      $url = $base;
+      $result = url('<front>', array('absolute' => $absolute));
+      $this->assertEqual($url, $result, t('Creation of @absolute internal url using front with clean urls @clean_urls', $t_args));
     }
   }
+
+  /**
+   * Test external URL handling.
+   */
+  function testExternalUrls() {
+    $test_url = 'http://drupal.org/';
+
+    // Verify external URL can contain a fragment.
+    $url = $test_url . '#drupal';
+    $result = url($url);
+    $this->assertEqual($url, $result, t('External URL with fragment works without a fragment in $options.'));
+
+    // Verify fragment can be overidden in an external URL.
+    $url = $test_url . '#drupal';
+    $fragment = $this->randomName(10);
+    $result = url($url, array('fragment' => $fragment));
+    $this->assertEqual($test_url . '#' . $fragment, $result, t('External URL fragment is overidden with a custom fragment in $options.'));
+
+    // Verify external URL can contain a query string.
+    $url = $test_url . '?drupal=awesome';
+    $result = url($url);
+    $this->assertEqual($url, $result, t('External URL with query string works without a query string in $options.'));
+
+    // Verify external URL can be extended with a query string.
+    $url = $test_url;
+    $query = array($this->randomName(5) => $this->randomName(5));
+    $result = url($url, array('query' => $query));
+    $this->assertEqual($url . '?' . http_build_query($query), $result, t('External URL can be extended with a query string in $options.'));
+
+    // Verify query string can be extended in an external URL.
+    $url = $test_url . '?drupal=awesome';
+    $query = array($this->randomName(5) => $this->randomName(5));
+    $result = url($url, array('query' => $query));
+    $this->assertEqual($url . '&' . http_build_query($query), $result, t('External URL query string can be extended with a custom query string in $options.'));
+  }
 }
 
 class CommonSizeTestCase extends DrupalUnitTestCase {
@@ -225,54 +299,6 @@ class DrupalTagsHandlingTestCase extends
 }
 
 /**
- * Tests url().
- */
-class UrlTestCase extends DrupalWebtestCase {
-
-  public static function getInfo() {
-    return array(
-      'name' => 'Tests for the url() function',
-      'description' => 'Performs tests on the url() function.',
-      'group' => 'System',
-    );
-  }
-
-  /**
-   * Test the url() function's $options array.
-   *
-   * Assert that calling url() with an external URL
-   *   1. containing a fragment works with and without a fragment in $options.
-   *   2. containing or not containing a query works with a query in $options.
-   */
-  function testUrlOptions() {
-    // Testing the fragment handling.
-    $fragment = $this->randomName(10);
-    $test_url = 'http://www.drupal.org/#' . $fragment;
-
-    $result_url = url($test_url);
-    $this->assertEqual($test_url, $result_url, t("External URL containing a fragment works without a fragment in options. url('http://drupal.org/#frag1');"));
-
-    $result_url = url($test_url, array('fragment' => $fragment));
-    $this->assertEqual($test_url, $result_url, t("External URL containing a fragment works with a fragment in options. url('http://drupal.org/#frag1', array('fragment' => 'frag1'));"));
-
-    // Testing the query handling.
-    $query = $this->randomName(10);
-    $query2 = $this->randomName(10);
-    $test_url = 'http://www.drupal.org/?' . $query;
-
-    // The external URL contains a query.
-    $result_url = url($test_url, array('query' => $query2));
-    $this->assertEqual($test_url . '&' . $query2, $result_url, t("External URL with a query passed in the path paramater. url('http://drupal.org/?param1', array('query' => 'param2'));"));
-
-    // The external URL does not contain a query.
-    $test_url = 'http://www.drupal.org';
-    $result_url = url($test_url, array('query' => $query2));
-    $this->assertEqual($test_url . '?' . $query2, $result_url, t("External URL without a query passed in the path paramater. url('http://drupal.org', array('query' => 'param2'));"));
-  }
-
-}
-
-/**
  * Test the Drupal CSS system.
  */
 class CascadingStylesheetsTestCase extends DrupalWebTestCase {
@@ -553,9 +579,15 @@ class DrupalHTTPRequestTestCase extends 
 
   function testDrupalGetDestination() {
     $query = $this->randomName(10);
-    $url = url('system-test/destination', array('absolute' => TRUE, 'query' => $query));
-    $this->drupalGet($url);
-    $this->assertText($query, t('The query passed to the page is correctly represented by drupal_get_detination().'));
+
+    // Verify that a 'destination' query string is used as destination.
+    $this->drupalGet('system-test/destination', array('query' => array('destination' => $query)));
+    $this->assertText('The destination: ' . $query, t('The given query string destination is determined as destination.'));
+
+    // Verify that the current path is used as destination.
+    $this->drupalGet('system-test/destination', array('query' => array($query => NULL)));
+    $url = 'system-test/destination?' . $query;
+    $this->assertText('The destination: ' . $url, t('The current path is determined as destination.'));
   }
 }
 
Index: modules/simpletest/tests/form.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/form.test,v
retrieving revision 1.15
diff -u -p -r1.15 form.test
--- modules/simpletest/tests/form.test	18 Sep 2009 00:12:48 -0000	1.15
+++ modules/simpletest/tests/form.test	18 Sep 2009 17:18:17 -0000
@@ -430,10 +430,10 @@ class FormsFormStorageTestCase extends D
     $user = $this->drupalCreateUser(array('access content'));
     $this->drupalLogin($user);
 
-    $this->drupalPost('form_test/form-storage', array('title' => 'new', 'value' => 'value_is_set'), 'Continue', array('query' => 'cache=1'));
+    $this->drupalPost('form_test/form-storage', array('title' => 'new', 'value' => 'value_is_set'), 'Continue', array('query' => array('cache' => 1)));
     $this->assertText('Form constructions: 1', t('The form has been constructed one time till now.'));
 
-    $this->drupalPost(NULL, array(), 'Save', array('query' => 'cache=1'));
+    $this->drupalPost(NULL, array(), 'Save', array('query' => array('cache' => 1)));
     $this->assertText('Form constructions: 2', t('The form has been constructed two times till now.'));
     $this->assertText('Title: new', t('The form storage has stored the values.'));
   }
Index: modules/simpletest/tests/system_test.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/system_test.module,v
retrieving revision 1.15
diff -u -p -r1.15 system_test.module
--- modules/simpletest/tests/system_test.module	17 Aug 2009 20:32:30 -0000	1.15
+++ modules/simpletest/tests/system_test.module	18 Sep 2009 17:18:17 -0000
@@ -116,7 +116,8 @@ function system_test_redirect_invalid_sc
 }
 
 function system_test_destination() {
-  return 'The destination: ' . drupal_get_destination();
+  $destination = drupal_get_destination();
+  return 'The destination: ' . $destination['destination'];
 }
 
 /**
Index: modules/statistics/statistics.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/statistics/statistics.admin.inc,v
retrieving revision 1.32
diff -u -p -r1.32 statistics.admin.inc
--- modules/statistics/statistics.admin.inc	29 Aug 2009 03:32:46 -0000	1.32
+++ modules/statistics/statistics.admin.inc	18 Sep 2009 17:18:17 -0000
@@ -130,9 +130,9 @@ function statistics_top_visitors() {
 
   $result = $query->execute();
   $rows = array();
+  $destination = drupal_get_destination();
   foreach ($result as $account) {
-    $qs = drupal_get_destination();
-    $ban_link =  $account->iid ? l(t('unblock IP address'), "admin/config/people/ip-blocking/delete/$account->iid", array('query' => $qs)) : l(t('block IP address'), "admin/config/people/ip-blocking/$account->hostname", array('query' => $qs));
+    $ban_link = $account->iid ? l(t('unblock IP address'), "admin/config/people/ip-blocking/delete/$account->iid", array('query' => $destination)) : l(t('block IP address'), "admin/config/people/ip-blocking/$account->hostname", array('query' => $destination));
     $rows[] = array($account->hits, ($account->uid ? theme('username', $account) : $account->hostname), format_interval(round($account->total / 1000)), (user_access('block IP addresses') && !$account->uid) ? $ban_link : '');
   }
 
Index: modules/system/system.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.install,v
retrieving revision 1.386
diff -u -p -r1.386 system.install
--- modules/system/system.install	18 Sep 2009 00:04:23 -0000	1.386
+++ modules/system/system.install	18 Sep 2009 17:18:17 -0000
@@ -183,7 +183,7 @@ function system_requirements($phase) {
     }
 
     $description .= ' ' . $t('You can <a href="@cron">run cron manually</a>.', array('@cron' => url('admin/reports/status/run-cron')));
-    $description .= '<br />' . $t('To run cron from outside the site, go to <a href="!cron">!cron</a>', array('!cron' => url($base_url . '/cron.php', array('external' => TRUE, 'query' => 'cron_key=' . variable_get('cron_key', 'drupal')))));
+    $description .= '<br />' . $t('To run cron from outside the site, go to <a href="!cron">!cron</a>', array('!cron' => url($base_url . '/cron.php', array('external' => TRUE, 'query' => array('cron_key' => variable_get('cron_key', 'drupal'))))));
 
     $requirements['cron'] = array(
       'title' => $t('Cron maintenance tasks'),
Index: modules/system/system.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.module,v
retrieving revision 1.791
diff -u -p -r1.791 system.module
--- modules/system/system.module	18 Sep 2009 00:12:48 -0000	1.791
+++ modules/system/system.module	18 Sep 2009 17:18:17 -0000
@@ -2308,7 +2308,7 @@ function system_admin_compact_mode() {
 function system_admin_compact_page($mode = 'off') {
   global $user;
   user_save($user, array('admin_compact_mode' => ($mode == 'on')));
-  drupal_goto(drupal_get_destination());
+  drupal_goto($_GET['q'], drupal_get_destination());
 }
 
 /**
Index: modules/system/system.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.test,v
retrieving revision 1.76
diff -u -p -r1.76 system.test
--- modules/system/system.test	18 Sep 2009 00:12:48 -0000	1.76
+++ modules/system/system.test	18 Sep 2009 17:18:17 -0000
@@ -379,12 +379,12 @@ class CronRunTestCase extends DrupalWebT
 
     // Run cron anonymously with a random cron key.
     $key = $this->randomName(16);
-    $this->drupalGet($base_url . '/cron.php', array('external' => TRUE, 'query' => 'cron_key=' . $key));
+    $this->drupalGet($base_url . '/cron.php', array('external' => TRUE, 'query' => array('cron_key' => $key)));
     $this->assertResponse(403);
 
     // Run cron anonymously with the valid cron key.
     $key = variable_get('cron_key', 'drupal');
-    $this->drupalGet($base_url . '/cron.php', array('external' => TRUE, 'query' => 'cron_key=' . $key));
+    $this->drupalGet($base_url . '/cron.php', array('external' => TRUE, 'query' => array('cron_key' => $key)));
     $this->assertResponse(200);
 
     // Execute cron directly.
Index: modules/translation/translation.pages.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/translation/translation.pages.inc,v
retrieving revision 1.8
diff -u -p -r1.8 translation.pages.inc
--- modules/translation/translation.pages.inc	29 Jul 2009 06:39:35 -0000	1.8
+++ modules/translation/translation.pages.inc	18 Sep 2009 17:18:17 -0000
@@ -47,7 +47,7 @@ function translation_node_overview($node
       // No such translation in the set yet: help user to create it.
       $title = t('n/a');
       if (node_access('create', $node)) {
-        $options[] = l(t('add translation'), 'node/add/' . str_replace('_', '-', $node->type), array('query' => "translation=$node->nid&language=$language->language"));
+        $options[] = l(t('add translation'), 'node/add/' . str_replace('_', '-', $node->type), array('query' => array('translation' => $node->nid, 'language' => $language->language)));
       }
       $status = t('Not translated');
     }
Index: modules/user/user.pages.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/user/user.pages.inc,v
retrieving revision 1.53
diff -u -p -r1.53 user.pages.inc
--- modules/user/user.pages.inc	18 Sep 2009 00:12:48 -0000	1.53
+++ modules/user/user.pages.inc	18 Sep 2009 17:18:17 -0000
@@ -284,14 +284,13 @@ function user_profile_form_submit($form,
   cache_clear_all();
 
   drupal_set_message(t('The changes have been saved.'));
-  return;
 }
 
 /**
  * Submit function for the 'Cancel account' button on the user edit form.
  */
 function user_edit_cancel_submit($form, &$form_state) {
-  $destination = '';
+  $destination = array();
   if (isset($_REQUEST['destination'])) {
     $destination = drupal_get_destination();
     unset($_REQUEST['destination']);
