Index: system.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.module,v
retrieving revision 1.682
diff -u -p -r1.682 system.module
--- system.module	22 Apr 2009 09:45:03 -0000	1.682
+++ system.module	22 Apr 2009 19:44:23 -0000
@@ -1467,6 +1467,12 @@ function confirm_form($form, $question, 
     $fragment = isset($path['fragment']) ? $path['fragment'] : NULL;
     $path = isset($path['path']) ? $path['path'] : NULL;
   }
+  elseif (strpos($path, '?') !== FALSE) {
+    list($path, $query) = explode('?', $path);
+    if (strpos($query, '#') !== FALSE) {
+      list($query, $fragment) = explode('#', $query);
+    }
+  }
   $cancel = l($no ? $no : t('Cancel'), $path, array('query' => $query, 'fragment' => $fragment));
 
   drupal_set_title($question, PASS_THROUGH);
