Index: includes/form.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/form.inc,v
retrieving revision 1.265.2.19
diff -u -p -r1.265.2.19 form.inc
--- includes/form.inc	22 Feb 2009 18:12:46 -0000	1.265.2.19
+++ includes/form.inc	17 Mar 2009 10:04:04 -0000
@@ -624,6 +624,12 @@ function drupal_redirect_form($form, $re
   }
   if (!isset($goto) || ($goto !== FALSE)) {
     if (isset($goto)) {
+      // Remove any fake destination set by drupal_not_found() or
+      // drupal_access_denied() so that we can properly redirect from those
+      // pages.
+      if (isset($_REQUEST['destination']) && $_REQUEST['destination'] == $_GET['q']) {
+        unset($_REQUEST['destination']);
+      }
       if (is_array($goto)) {
         call_user_func_array('drupal_goto', $goto);
       }
