Index: modules/node.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/node.module,v
retrieving revision 1.509
diff -u -F^f -r1.509 node.module
--- modules/node.module	20 Jul 2005 10:48:20 -0000	1.509
+++ modules/node.module	27 Jul 2005 11:41:25 -0000
@@ -413,17 +413,8 @@ function node_save($node) {
     }
     $node->nid = db_next_id('{node}_nid');
 
-    // Prepare the query:
-    foreach ($node as $key => $value) {
-      if (in_array((string) $key, $fields)) {
-        $k[] = db_escape_string($key);
-        $v[] = $value;
-        $s[] = "'%s'";
-      }
-    }
-
     // Insert the node into the database:
-    db_query("INSERT INTO {node} (". implode(", ", $k) .") VALUES(". implode(", ", $s) .")", $v);
+    db_query('INSERT INTO {node} %a', object2array($node));
 
     // Call the node specific callback (if any):
     node_invoke($node, 'insert');
