Index: modules/system/system.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.module,v
retrieving revision 1.416
diff -u -r1.416 system.module
--- modules/system/system.module	29 Nov 2006 23:12:41 -0000	1.416
+++ modules/system/system.module	30 Nov 2006 23:43:21 -0000
@@ -2094,6 +2094,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
@@ -2108,6 +2109,17 @@
  */
 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;
+    $cancel = l($no ? $no : t('Cancel'), $path, array(), $query, $fragment);
+  }
+  else {
+    $cancel = l($no ? $no : t('Cancel'), $path);
+  }
+
   drupal_set_title($question);
   $form['#attributes'] = array('class' => 'confirmation');
   $form['description'] = array('#value' => $description);
@@ -2115,7 +2127,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' => $cancel);
   $form['#base'] = 'confirm_form';
   return $form;
 }
