summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/node/content_types.inc6
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/node/content_types.inc b/modules/node/content_types.inc
index c298ed2fe..251a49066 100644
--- a/modules/node/content_types.inc
+++ b/modules/node/content_types.inc
@@ -86,7 +86,7 @@ function node_type_form($type = NULL) {
'#default_value' => $type->type,
'#maxlength' => 32,
'#required' => TRUE,
- '#description' => t('The machine-readable name of this content type. This text will be used for constructing the URL of the <em>create content</em> page for this content type. It is recommended that this name consists only of lowercase letters, numbers, and <strong>underscores</strong>. Dashes are not allowed. Underscores will be converted into dashes when constructing the URL of the <em>create content</em> page. The name must be unique to this content type.'),
+ '#description' => t('The machine-readable name of this content type. This text will be used for constructing the URL of the <em>create content</em> page for this content type. This name may consist of only of lowercase letters, numbers, and underscores. Dashes are not allowed. Underscores will be converted into dashes when constructing the URL of the <em>create content</em> page. The name must be unique to this content type.'),
);
}
else {
@@ -231,8 +231,8 @@ function node_type_form_validate($form_id, $form_values) {
if (isset($types[$type->type]) && $type->type != $old_type) {
form_set_error('type', t('The machine-readable name %type is already taken.', array('%type' => $type->type)));
}
- if (strpos($type->type, '-') !== FALSE) {
- form_set_error('type', t('The machine-readable name cannot contain dashes.', array('%type' => $type->type)));
+ 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.'));
}
}