summaryrefslogtreecommitdiff
path: root/modules/node
diff options
context:
space:
mode:
authorNeil Drumm <drumm@3064.no-reply.drupal.org>2006-12-29 08:22:15 +0000
committerNeil Drumm <drumm@3064.no-reply.drupal.org>2006-12-29 08:22:15 +0000
commit98529b936b948df1e55a7117cff23a993b9a045d (patch)
tree5e181a448a73664a9a249b597f8fcd9510a82685 /modules/node
parentb1c11d267f3105a4ccac9b7f4e0bd2e18d490f45 (diff)
downloadbrdo-98529b936b948df1e55a7117cff23a993b9a045d.tar.gz
brdo-98529b936b948df1e55a7117cff23a993b9a045d.tar.bz2
#104352 by pwolanin. Dissallow the type name '0' which confuses Drupal.
Diffstat (limited to 'modules/node')
-rw-r--r--modules/node/content_types.inc4
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/node/content_types.inc b/modules/node/content_types.inc
index 59a1f5e8f..90dab7296 100644
--- a/modules/node/content_types.inc
+++ b/modules/node/content_types.inc
@@ -237,6 +237,10 @@ function node_type_form_validate($form_id, $form_values) {
if (!preg_match('!^[a-z0-9_]+$!', $type->type)) {
form_set_error('type', t('The machine-readable name can only consist of lowercase letters, underscores, and numbers.'));
}
+ // 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)."));
+ }
}
$names = array_flip($types);