diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/profile.module | 6 | ||||
-rw-r--r-- | modules/profile/profile.module | 6 |
2 files changed, 8 insertions, 4 deletions
diff --git a/modules/profile.module b/modules/profile.module index cdb6fa98a..4b9401776 100644 --- a/modules/profile.module +++ b/modules/profile.module @@ -462,13 +462,11 @@ function profile_user($type, &$edit, &$user, $category = NULL) { function profile_validate_form($edit) { // Validate the title: - if (!$edit['title']) { form_set_error('title', t('You must enter a title.')); } // Validate the 'form name': - if (eregi('[^a-z0-9_-]', $edit['name'])) { form_set_error('name', t('The specified form name contains one or more illegal characters. Spaces or any other special characters expect dash (-) and underscore (_) are not allowed.')); } @@ -481,6 +479,10 @@ function profile_validate_form($edit) { if (!$edit['category']) { form_set_error('category', t('You must enter a category.')); } + + if ($edit['category'] == 'account') { + form_set_error('category', t('The specified category name is reserved for use by Drupal.')); + } } /** diff --git a/modules/profile/profile.module b/modules/profile/profile.module index cdb6fa98a..4b9401776 100644 --- a/modules/profile/profile.module +++ b/modules/profile/profile.module @@ -462,13 +462,11 @@ function profile_user($type, &$edit, &$user, $category = NULL) { function profile_validate_form($edit) { // Validate the title: - if (!$edit['title']) { form_set_error('title', t('You must enter a title.')); } // Validate the 'form name': - if (eregi('[^a-z0-9_-]', $edit['name'])) { form_set_error('name', t('The specified form name contains one or more illegal characters. Spaces or any other special characters expect dash (-) and underscore (_) are not allowed.')); } @@ -481,6 +479,10 @@ function profile_validate_form($edit) { if (!$edit['category']) { form_set_error('category', t('You must enter a category.')); } + + if ($edit['category'] == 'account') { + form_set_error('category', t('The specified category name is reserved for use by Drupal.')); + } } /** |