Index: modules/node/content_types.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/content_types.inc,v
retrieving revision 1.49
diff -u -r1.49 content_types.inc
--- modules/node/content_types.inc	22 Dec 2007 23:24:25 -0000	1.49
+++ modules/node/content_types.inc	8 Jan 2008 23:19:47 -0000
@@ -233,9 +233,23 @@
     if (!preg_match('!^[a-z0-9_]+$!', $type->type)) {
       form_set_error('type', t('The machine-readable name must contain only lowercase letters, numbers, and underscores.'));
     }
-    // The type cannot be just the character '0', since elsewhere we check it using empty().
-    if ($type->type === '0') {
-      form_set_error('type', t("Invalid type. Please enter a type name other than '0' (the character zero)."));
+    $valid_type = TRUE; 
+    // 'add' and 'list' conflict with the menu system.
+    // 'theme' conflicts with theme_node_form().
+    // '0' is invalid, since elsewhere we check it using empty().
+    foreach(array('add', 'list', 'theme', '0') as $invalid) {
+      if ($type->type === $invalid) {
+        $valid_type = FALSE;
+      }
+    }
+    // Check if a menu item of the form 'admin/content/types/'. $type->type is already defined
+    if ($router_item = menu_get_item('admin/content/types/'. $type->type)) {
+      if ($type->type != $old_type &&  $router_item['path'] == 'admin/content/types/'. $type->type) {
+        $valid_type = FALSE;
+      }
+    }
+    if (!$valid_type) {
+      form_set_error('type', t("Invalid type. Please enter a type name other than '!invalid'.", array('!invalid' => $type->type)));
     }
   }
 
