Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.790
diff -u -p -r1.790 common.inc
--- includes/common.inc	6 Sep 2008 15:06:10 -0000	1.790
+++ includes/common.inc	7 Sep 2008 22:28:31 -0000
@@ -275,30 +275,40 @@ function drupal_get_destination() {
  *
  * @param $path
  *   A Drupal path or a full URL.
- * @param $query
- *   A query string component, if any.
- * @param $fragment
- *   A destination fragment identifier (named anchor).
- * @param $http_response_code
- *   Valid values for an actual "goto" as per RFC 2616 section 10.3 are:
- *   - 301 Moved Permanently (the recommended value for most redirects)
- *   - 302 Found (default in Drupal and PHP, sometimes used for spamming search
- *         engines)
- *   - 303 See Other
- *   - 304 Not Modified
- *   - 305 Use Proxy
- *   - 307 Temporary Redirect (alternative to "503 Site Down for Maintenance")
- *   Note: Other values are defined by RFC 2616, but are rarely used and poorly
- *   supported.
+ * @param $options
+ *   An associative array of additional options, with the following keys:
+ *     'query'
+ *       A query string to append to the link, or an array of query key/value
+ *       properties.
+ *     'fragment'
+ *       A fragment identifier (named anchor) to append to the link.
+ *       Do not include the '#' character.
+ *     'http_response_code' (default 302)
+ *       Valid values for an actual "goto" as per RFC 2616 section 10.3 are:
+ *       - 301 Moved Permanently (the recommended value for most redirects)
+ *       - 302 Found (default in Drupal and PHP, sometimes used for spamming search
+ *             engines)
+ *       - 303 See Other
+ *       - 304 Not Modified
+ *       - 305 Use Proxy
+ *       - 307 Temporary Redirect (alternative to "503 Site Down for Maintenance")
+ *       Note: Other values are defined by RFC 2616, but are rarely used and poorly
+ *       supported.
  * @see drupal_get_destination()
  */
-function drupal_goto($path = '', $query = NULL, $fragment = NULL, $http_response_code = 302) {
+function drupal_goto($path = '', $options = array()) {
+
+  $options += array(
+    'query' => NULL,
+    'fragment' => NULL,
+    'http_response_code' => 302
+  );
 
   if (isset($_REQUEST['destination'])) {
     extract(parse_url(urldecode($_REQUEST['destination'])));
   }
 
-  $url = url($path, array('query' => $query, 'fragment' => $fragment, 'absolute' => TRUE));
+  $url = url($path, array('query' => $options['query'], 'fragment' => $options['fragment'], 'absolute' => TRUE));
   // Remove newlines from the URL to avoid header injection attacks.
   $url = str_replace(array("\n", "\r"), '', $url);
 
@@ -312,7 +322,7 @@ function drupal_goto($path = '', $query 
   // need all session data written to the database before redirecting.
   session_write_close();
 
-  header('Location: ' . $url, TRUE, $http_response_code);
+  header('Location: ' . $url, TRUE, $options['http_response_code']);
 
   // The "Location" header sends a redirect status code to the HTTP daemon. In
   // some cases this can be wrong, so we make sure none of the code below the
Index: includes/form.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/form.inc,v
retrieving revision 1.282
diff -u -p -r1.282 form.inc
--- includes/form.inc	6 Sep 2008 08:36:19 -0000	1.282
+++ includes/form.inc	7 Sep 2008 22:28:32 -0000
@@ -621,7 +621,7 @@ function drupal_redirect_form($form, $re
   if (!isset($goto) || ($goto !== FALSE)) {
     if (isset($goto)) {
       if (is_array($goto)) {
-        call_user_func_array('drupal_goto', $goto);
+        call_user_func_array('drupal_goto', array($goto[0]));
       }
       else {
         drupal_goto($goto);
@@ -2494,7 +2494,7 @@ function batch_process($redirect = NULL,
       // Actually store the batch data and the token generated form the batch id.
       db_query("UPDATE {batch} SET token = '%s', batch = '%s' WHERE bid = %d", drupal_get_token($batch['id']), serialize($batch), $batch['id']);
 
-      drupal_goto($batch['url'], 'op=start&id=' . $batch['id']);
+      drupal_goto($batch['url'], array('query' => 'op=start&id=' . $batch['id']));
     }
     else {
       // Non-progressive execution: bypass the whole progressbar workflow
Index: modules/openid/openid.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/openid/openid.module,v
retrieving revision 1.28
diff -u -p -r1.28 openid.module
--- modules/openid/openid.module	6 Sep 2008 08:36:20 -0000	1.28
+++ modules/openid/openid.module	7 Sep 2008 22:28:32 -0000
@@ -413,7 +413,7 @@ function openid_authentication($response
       // We'll want to redirect back to the same place.
       $destination = drupal_get_destination();
       unset($_REQUEST['destination']);
-      drupal_goto('user/register', $destination);
+      drupal_goto('user/register', array('query' => $destination));
     }
     else {
       unset($form_state['values']['response']);
