#108379: Faster profile field validation (eregi to preg_match)

5.x
Steven Wittens 2007-01-11 03:31:18 +00:00
parent c4c9d2a5d5
commit 7f2a4fbfc5
1 changed files with 1 additions and 1 deletions

View File

@ -306,7 +306,7 @@ Unless you know what you are doing, it is highly recommended that you prefix the
*/
function profile_field_form_validate($form_id, $form_values) {
// Validate the 'field name':
if (eregi('[^a-z0-9_-]', $form_values['name'])) {
if (preg_match('/[^a-zA-Z0-9_-]/', $form_values['name'])) {
form_set_error('name', t('The specified form name contains one or more illegal characters. Spaces or any other special characters except dash (-) and underscore (_) are not allowed.'));
}