Index: modules/system/system.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.module,v
retrieving revision 1.408
diff -u -r1.408 system.module
--- modules/system/system.module	26 Nov 2006 02:20:01 -0000	1.408
+++ modules/system/system.module	26 Nov 2006 21:58:53 -0000
@@ -2071,6 +2071,7 @@
  *   block <em>foo</em>?").
  * @param $path
  *   The page to go to if the user denies the action.
+ *   Can be either a drupal path, or an array with the keys 'path', 'query', 'fragment'.
  * @param $description
  *   Additional text to display (defaults to "This action cannot be undone.").
  * @param $yes
@@ -2085,6 +2086,13 @@
  */
 function confirm_form($form, $question, $path, $description = NULL, $yes = NULL, $no = NULL, $name = 'confirm') {
   $description = ($description) ? $description : t('This action cannot be undone.');
+
+  if (is_array($path)) {
+    $query = isset($path['query']) ? $path['query'] : NULL;
+    $fragment = isset($path['fragment']) ? $path['fragment'] : NULL;
+    $path = isset($path['$path']) ? $path['$path'] : NULL;
+  }
+
   drupal_set_title($question);
   $form['#attributes'] = array('class' => 'confirmation');
   $form['description'] = array('#value' => $description);
@@ -2092,7 +2100,7 @@
 
   $form['actions'] = array('#prefix' => '<div class="container-inline">', '#suffix' => '</div>');
   $form['actions']['submit'] = array('#type' => 'submit', '#value' => $yes ? $yes : t('Confirm'));
-  $form['actions']['cancel'] = array('#value' => l($no ? $no : t('Cancel'), $path));
+  $form['actions']['cancel'] = array('#value' => l($no ? $no : t('Cancel'), $path, null, $query, $fragment));
   $form['#base'] = 'confirm_form';
   return $form;
 }
