Closed (duplicate)
Project:
Drupal core
Version:
6.x-dev
Component:
user system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
21 Jul 2009 at 18:08 UTC
Updated:
7 Apr 2010 at 23:10 UTC
We use email addresses as our usernames and military email addresses (some.name@domain.mil) are returning message "The username is not a valid authentication ID."
We tested this code from the user.module:
if (strpos($name, '@') !== FALSE && !eregi('@([0-9a-z](-?[0-9a-z])*.)+[a-z]{2}([zmuvtg]|fo|me)?$', $name)) return t('The username is not a valid authentication ID.');
and found that if we added an l to [zmuvtg] then it would return true.
Can this code be fixed to accept military email addresses as username?
Comments
Comment #1
mikey_p commentedSince this isn't the actually email address, but the username, I'm not sure why we have regex in there to check against common email formats? If we do, why don't we just use valid_email_address()?
Comment #2
csc4 commentedI have a similar problem and thought that I could solve it by allowing the @ in access rules - but there seems no connection between the access rules allowed patterns and the check - so it still throws an error regardless? Is that correct?
Comment #3
drfuzetto commentedI get the error message anytime I try to register with an email address that contains .mil.
Did you solve your problem? If so, how?
Comment #4
tfleming commentedWe were having the same problem, and - despite not being a Drupal programmer - I knew enough to track down the file mentioned above in our file manager and add the lower-case L where indicated, and it worked.
But as a old-school HTML programmer and current social media manager, I have to ask user.module creators -- how did this very basic oversight occur? Why in the world would .mil addresses not have been standard programming?
Comment #5
sbandyopadhyay commentedThis issue gets fixed by the patch in #266488: Cleanup for user_validate_name() + tests, so I'm marking it as a duplicate.