Index: node.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.module,v
retrieving revision 1.738
diff -u -p -r1.738 node.module
--- node.module	27 Nov 2006 02:28:18 -0000	1.738
+++ node.module	28 Nov 2006 14:24:18 -0000
@@ -1158,7 +1158,7 @@ function node_menu($may_cache) {
           'type' => MENU_LOCAL_TASK);
         $items[] = array('path' => 'node/'. arg(1) .'/delete', 'title' => t('Delete'),
           'callback' => 'drupal_get_form',
-          'callback arguments' => array('node_delete_confirm'),
+          'callback arguments' => array('node_delete_confirm', $node),
           'access' => node_access('delete', $node),
           'weight' => 1,
           'type' => MENU_CALLBACK);
@@ -2214,20 +2214,16 @@ function node_form_submit($form_id, $for
 /**
  * Menu callback -- ask for confirmation of node deletion
  */
-function node_delete_confirm() {
-  $edit = $_POST;
-  $edit['nid'] = $edit['nid'] ? $edit['nid'] : arg(1);
-  $node = node_load($edit['nid']);
-
-  if (node_access('delete', $node)) {
-    $form['nid'] = array('#type' => 'value', '#value' => $node->nid);
-    $output = confirm_form($form,
-                   t('Are you sure you want to delete %title?', array('%title' => $node->title)),
-                   $_GET['destination'] ? $_GET['destination'] : 'node/'. $node->nid, t('This action cannot be undone.'),
-                   t('Delete'), t('Cancel')  );
-  }
+function node_delete_confirm($node) {
+ $form['nid'] = array('#type' => 'value', '#value' => $node->nid);
 
-  return $output;
+ return confirm_form(
+   $form,
+   t('Are you sure you want to delete %title?', array('%title' => $node->title)),
+   $_GET['destination'] ? $_GET['destination'] : 'node/'. $node->nid,
+   t('This action cannot be undone.'),
+   t('Delete'), t('Cancel')
+  );
 }
 
 /**
