Index: includes/ajax.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/ajax.inc,v
retrieving revision 1.8
diff -u -p -r1.8 ajax.inc
--- includes/ajax.inc	5 Sep 2009 15:05:01 -0000	1.8
+++ includes/ajax.inc	20 Sep 2009 01:46:23 -0000
@@ -184,7 +184,7 @@ function ajax_get_form() {
   }
 
   // Since some of the submit handlers are run, redirects need to be disabled.
-  $form['#redirect'] = FALSE;
+  $form_state['no_redirect'] = TRUE;
 
   // The form needs to be processed; prepare for that by setting a few internal
   // variables.
Index: includes/batch.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/batch.inc,v
retrieving revision 1.37
diff -u -p -r1.37 batch.inc
--- includes/batch.inc	26 Aug 2009 15:00:17 -0000	1.37
+++ includes/batch.inc	20 Sep 2009 02:01:02 -0000
@@ -441,12 +441,11 @@ function _batch_finished() {
     }
 
     // Use drupal_redirect_form() to handle the redirection logic.
-    $form = isset($batch['form']) ? $batch['form'] : array();
-    if (empty($_batch['form_state']['rebuild']) && empty($_batch['form_state']['storage'])) {
-      drupal_redirect_form($form, $redirect);
+    if (empty($_batch['form_state']['rebuild']) && empty($_batch['form_state']['storage']) && empty($_batch['form_state']['no_redirect'])) {
+      drupal_redirect_form($redirect);
     }
 
-    // We get here if $form['#redirect'] was FALSE, or if the form is a
+    // We get here if $form_state['no_redirect'] was TRUE, or if the form is a
     // multi-step form. We save the final $form_state value to be retrieved
     // by drupal_get_form(), and redirect to the originating page.
     $_SESSION['batch_form_state'] = $_batch['form_state'];
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	20 Sep 2009 02:05:38 -0000
@@ -581,17 +581,17 @@ function drupal_process_form($form_id, &
 
       // The form is executed. By default, we're finished now and redirect to a
       // new destination page. The path of the destination page can be set in
-      // $form['#redirect'] or $form_state['redirect']. If neither of the two is
-      // set, the user is redirect to the current page, which means a fresh,
-      // unpopulated copy of the form.
+      // $form_state['redirect']. If that is not set, the user is redirect to
+      // the current page, which means a fresh, unpopulated copy of the form.
       // Redirection is skipped, though, if
-      // - the form was called by drupal_form_submit(),
+      // - the form was called by drupal_form_submit().
       // - the form has to be rebuilt because either $form_state['rebuild'] was
-      //   set to TRUE or $form_state['storage'] was populated by a submit handler.
-      // - $form_state['no_redirect'] is set to TRUE,
-      // - $form_state['redirect'] or $form['#redirect'] is set to FALSE.
+      //   set to TRUE or $form_state['storage'] was populated by a submit
+      //   handler.
+      // - $form_state['no_redirect'] is set to TRUE.
+      // - $form_state['redirect'] is set to FALSE.
       if (!$form_state['programmed'] && empty($form_state['rebuild']) && empty($form_state['storage']) && empty($form_state['no_redirect'])) {
-        drupal_redirect_form($form, $form_state['redirect']);
+        drupal_redirect_form($form_state['redirect']);
       }
     }
   }
@@ -734,20 +734,15 @@ function drupal_validate_form($form_id, 
 /**
  * Redirect the user to a URL after a form has been processed.
  *
- * @param $form
- *   An associative array containing the structure of the form.
  * @param $redirect
- *   An optional value containing the destination path to redirect
- *   to if none is specified by the form.
+ *   (optional) A destination path to redirect to. This is usually
+ *   $form_state['redirect'], which may be FALSE to specifically skip
+ *   redirection.
  */
-function drupal_redirect_form($form, $redirect = NULL) {
-  $goto = NULL;
+function drupal_redirect_form($redirect = NULL) {
   if (isset($redirect)) {
     $goto = $redirect;
   }
-  if ($goto !== FALSE && isset($form['#redirect'])) {
-    $goto = $form['#redirect'];
-  }
   if (!isset($goto) || ($goto !== FALSE)) {
     if (isset($goto)) {
       if (is_array($goto)) {
Index: modules/openid/openid.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/openid/openid.module,v
retrieving revision 1.59
diff -u -p -r1.59 openid.module
--- modules/openid/openid.module	17 Sep 2009 03:16:16 -0000	1.59
+++ modules/openid/openid.module	20 Sep 2009 01:59:55 -0000
@@ -463,7 +463,7 @@ function openid_authentication($response
       // Let other modules act on OpenID login
       module_invoke_all('openid_response', $response, $account);
     }
-    drupal_redirect_form($form, $form_state['redirect']);
+    drupal_redirect_form($form_state['redirect']);
   }
   else {
     drupal_set_message(t('Only site administrators can create new user accounts.'), 'error');
Index: modules/openid/openid.pages.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/openid/openid.pages.inc,v
retrieving revision 1.21
diff -u -p -r1.21 openid.pages.inc
--- modules/openid/openid.pages.inc	18 Sep 2009 00:12:47 -0000	1.21
+++ modules/openid/openid.pages.inc	20 Sep 2009 01:56:10 -0000
@@ -111,5 +111,5 @@ function openid_user_delete_form_submit(
   if ($query) {
     drupal_set_message(t('OpenID deleted.'));
   }
-  $form_state['#redirect'] = 'user/' . $form_state['args'][0]->uid . '/openid';
+  $form_state['redirect'] = 'user/' . $form_state['args'][0]->uid . '/openid';
 }
Index: modules/system/system.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.admin.inc,v
retrieving revision 1.203
diff -u -p -r1.203 system.admin.inc
--- modules/system/system.admin.inc	19 Sep 2009 11:07:36 -0000	1.203
+++ modules/system/system.admin.inc	20 Sep 2009 01:57:27 -0000
@@ -1822,7 +1822,7 @@ function system_site_maintenance_mode() 
  * @ingroup forms
  * @see system_settings_form()
  */
-function system_clean_url_settings($form) {
+function system_clean_url_settings($form, &$form_state) {
   global $base_url;
 
   // When accessing this form using a non-clean URL, allow a re-check to make
@@ -1852,7 +1852,7 @@ function system_clean_url_settings($form
   else {
     drupal_add_js(drupal_get_path('module', 'system') . '/system.js');
 
-    $form['#redirect'] = $base_url . '/admin/config/search/clean-urls';
+    $form_state['redirect'] = $base_url . '/admin/config/search/clean-urls';
     $form['clean_url_description'] = array(
       '#type' => 'markup',
       '#markup' => '<p>' . t('Use URLs like <code>example.com/user</code> instead of <code>example.com/?q=user</code>.') . ' ' . t('If you are directed to a <em>Page not found (404)</em> error after testing for clean URLs, see the <a href="@handbook">online handbook</a>.', array('@handbook' => 'http://drupal.org/node/15365')) . '</p>',
Index: modules/taxonomy/taxonomy.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.admin.inc,v
retrieving revision 1.69
diff -u -p -r1.69 taxonomy.admin.inc
--- modules/taxonomy/taxonomy.admin.inc	18 Sep 2009 00:12:48 -0000	1.69
+++ modules/taxonomy/taxonomy.admin.inc	20 Sep 2009 02:19:37 -0000
@@ -469,10 +469,6 @@ function taxonomy_overview_terms($form, 
       '#type' => 'submit',
       '#value' => t('Reset to alphabetical')
     );
-    $form['destination'] = array(
-      '#type' => 'hidden',
-      '#value' => $_GET['q'] . (isset($_GET['page']) ? '?page=' . $_GET['page'] : '')
-    );
   }
 
   return $form;
@@ -779,9 +775,6 @@ function taxonomy_form_term($form, &$for
       '#type' => 'value',
       '#value' => $edit['tid']);
   }
-  else {
-    $form['destination'] = array('#type' => 'hidden', '#value' => $_GET['q']);
-  }
 
   return $form;
 }
Index: modules/user/user.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/user/user.module,v
retrieving revision 1.1048
diff -u -p -r1.1048 user.module
--- modules/user/user.module	19 Sep 2009 11:07:37 -0000	1.1048
+++ modules/user/user.module	20 Sep 2009 02:20:34 -0000
@@ -3076,9 +3076,6 @@ function user_register($form, &$form_sta
      '#type' => 'checkbox',
      '#title' => t('Notify user of new account')
     );
-    // Redirect back to page which initiated the create request;
-    // usually admin/people/create.
-    $form['destination'] = array('#type' => 'hidden', '#value' => $_GET['q']);
   }
 
   // Create a dummy variable for pass-by-reference parameters.
