### Eclipse Workspace Patch 1.0
#P drupal-head
Index: modules/profile/profile.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/profile/profile.admin.inc,v
retrieving revision 1.40
diff -u -r1.40 profile.admin.inc
--- modules/profile/profile.admin.inc	13 Apr 2010 15:23:03 -0000	1.40
+++ modules/profile/profile.admin.inc	16 Apr 2010 19:02:04 -0000
@@ -220,7 +220,7 @@
     '#title' => t('Category'),
     '#default_value' => $edit['category'],
     '#autocomplete_path' => 'admin/config/people/profile/autocomplete',
-    '#description' => t('The category the new field should be part of. Categories are used to group fields logically. An example category is "Personal information".'),
+    '#description' => t('The category the new field should be part of. Categories are used to group fields logically. Any special characters except dash (-), underscore (_) and whitespace characters ( ) are not allowed. An example category is "Personal information".'),
     '#required' => TRUE,
   );
   $form['title'] = array('#type' => 'textfield',
@@ -307,6 +307,9 @@
     form_set_error('name', t('The specified form name is reserved for use by Drupal.'));
   }
   // Validate the category:
+  if (preg_match('/[^a-zA-Z0-9_-\s]/', $form_state['values']['category'])) {
+    form_set_error('category', t('The specified category name contains one or more illegal characters. Any special characters except dash (-), underscore (_) and whitespace characters ( ) are not allowed.'));
+  }
   if (!$form_state['values']['category']) {
     form_set_error('category', t('You must enter a category.'));
   }
