Index: modules/overlay/overlay-parent.js
===================================================================
RCS file: /cvs/drupal/drupal/modules/overlay/overlay-parent.js,v
retrieving revision 1.27
diff -u -r1.27 overlay-parent.js
--- modules/overlay/overlay-parent.js	20 Feb 2010 14:48:38 -0000	1.27
+++ modules/overlay/overlay-parent.js	24 Feb 2010 19:44:12 -0000
@@ -838,8 +838,9 @@
   // true to prevent transforming this link into a clean URL while clean URLs
   // may be disabled.
   var path = self.getPath(link, true);
-  // Preserve existing query and fragment parameters in the URL.
-  var destination = path + link.search + link.hash;
+  // Preserve existing query and fragment parameters in the URL, except for
+  // "render=overlay" which is re-added in Drupal.overlay.hashchangeHandler.
+  var destination = path + link.search.replace(/&?render=overlay/, '').replace(/\?$/, '') + link.hash;
 
   // Assemble the overlay-ready link.
   var newLink = $.param.fragment(window.location.href, { overlay: destination });
@@ -873,7 +874,8 @@
     // Set a 'redirect' flag on the new location so the hashchange event handler
     // knows not to change the overlay's content.
     $.data(window.location, newLocation, 'redirect');
-    window.location.href = newLocation;
+    // Using location.replace so we don't create an extra history entry.
+    window.location.replace(newLocation);
   }
 };
 
