Closed (duplicate)
Project:
Drupal core
Version:
8.0.x-dev
Component:
user system
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
24 Oct 2012 at 15:50 UTC
Updated:
19 Sep 2014 at 22:51 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
kalabroMaybe we should run tests
Comment #2
kristen polI tested this in Drupal 7 (own patch with your code) and it works well. Thanks!
Comment #2.0
kristen polUpdated issue summary.
Comment #3
fuzzy76 commentedComment #4
fuzzy76 commentedAdded a D7 backport rolled against 7.x head.
Comment #6
attiks commentedComment #7
fuzzy76 commented3: d7-allow-plus-for-username-1821974-3.patch queued for re-testing.
Comment #9
fuzzy76 commentedSorry about that
Comment #10
durgeshs commented3: d7-allow-plus-for-username-1821974-3.patch no need to update core code.
Comment #12
durgeshs commentedI have tested core d7 and d8 for "Allow plus sign in user_validate_name to be able to use email as login", It is already working fine without any patch. I don't know why want to create new patch for that while already allow plus sign in user_validate_name for login and register.
Comment #13
durgeshs commentedI don't know why want to create new patch for that while already allow plus sign in user_validate_name for login and register.
Comment #14
attiks commentedIf I read the code correctly at https://api.drupal.org/api/drupal/modules%21user%21user.module/function/... it says
so a plus sign as part of the user name is not allowed.
Comment #15
maestrojed commentedI could not reproduce this issue on the latest d8 dev branch.
I was able to to create an account using a plus sign (+) in my username.
I confirmed the email address was stored with a + sign for this user. I confirmed by looking at both the admin panel (http://drupal8.dev/admin/people) and the database.
I did receive an error due to another issue. (I mention because you can see this error in my screenshot)
https://drupal.org/node/2281603
But this issue is separate and exists for email addresses without a + sign.
Although I could not reproduce this, if others can, I agree its important to allow plus signs in emails. Many google/gmail users are accustomed to creating email address aliases on the fly by including a plus sign.
I included a screenshot.
Comment #16
attiks commentedIf this is already working for D8, we need a backport for D7
Comment #17
attiks commented3: d7-allow-plus-for-username-1821974-3.patch queued for re-testing.
Comment #18
dcam commentedI tested this in D8 and adding a username with a '+' did result in the error shown in the screenshot below.

Note that in the screenshot I was testing it without the email domain to make sure there was no error from other punctuation characters.
I also checked the username validation code. The preg_match string is exactly the same as is mentioned for D7 in #14. See validate() in /core/modules/user/src/Plugin/Validation/Constraint/UserNameContraintValidator.php.
Comment #19
dcam commentedI'm closing this as a duplicate of #2157963: Allow + symbol in usernames. Although this is the older of the two issues, the D8 patch in the other issue is slightly more up-to-date.