Index: modules/overlay/overlay-child.js
===================================================================
RCS file: /cvs/drupal/drupal/modules/overlay/overlay-child.js,v
retrieving revision 1.1
diff -u -p -r1.1 overlay-child.js
--- modules/overlay/overlay-child.js	2 Dec 2009 07:28:22 -0000	1.1
+++ modules/overlay/overlay-child.js	9 Dec 2009 20:16:42 -0000
@@ -54,14 +54,6 @@ Drupal.behaviors.overlayChild = {
     // Ok, now we can tell the parent window we're ready.
     parent.Drupal.overlay.bindChild(window);
 
-    // If a form is being displayed, it has a hidden field for the parent
-    // window's location. Pass it that information. Letting the server side
-    // know the parent window's location lets us avoid unnecessary redirects
-    // when the overlay window is being closed automatically.
-    var re = new RegExp('^' + parent.Drupal.settings.basePath);
-    var path = parent.window.location.pathname.replace(re, '');
-    $('#edit-overlay-parent-url').val(path);
-
     // Install onBeforeUnload callback, if module is present.
     if ($.isObject(Drupal.onBeforeUnload) && !Drupal.onBeforeUnload.callbackExists('overlayChild')) {
       Drupal.onBeforeUnload.addCallback('overlayChild', function () {
Index: modules/overlay/overlay.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/overlay/overlay.module,v
retrieving revision 1.1
diff -u -p -r1.1 overlay.module
--- modules/overlay/overlay.module	2 Dec 2009 07:28:22 -0000	1.1
+++ modules/overlay/overlay.module	9 Dec 2009 20:16:42 -0000
@@ -146,20 +146,6 @@ function overlay_library() {
 }
 
 /**
- * Implements hook_form_alter().
- *
- * For forms displayed in the overlay, add a hidden form field that lets us pass
- * the parent window's URL into the form.
- */
-function overlay_form_alter(&$form, &$form_state, $form_id) {
-  if (overlay_get_mode() == 'child') {
-    $form['overlay_parent_url'] = array(
-      '#type' => 'hidden',
-    );
-  }
-}
-
-/**
  * Implements hook_drupal_goto_alter().
  *
  * If the current page request is inside the overlay, add ?render=overlay to
@@ -382,11 +368,6 @@ function overlay_form_submit($form, &$fo
       if (!empty($form_state['redirect'])) {
         $settings['overlayChild']['redirect'] = url($url, $settings);
       }
-      // If the redirect destination is the same as the parent window, just
-      // close the overlay without redirecting the parent.
-      if (url($form['overlay_parent_url']['#value']) == $settings['overlayChild']['redirect']) {
-        unset($settings['overlayChild']['redirect']);
-      }
       drupal_add_js($settings, array('type' => 'setting'));
     }
     // Tell FAPI to redraw the form without redirection after all submit
