Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#17239 closed defect (bug) (fixed)

create username with dots

Reported by: lbf1 Owned by: ryan
Milestone: 3.2 Priority: normal
Severity: trivial Version: 3.1
Component: Users Keywords: has-patch
Focuses: Cc:


at 'Users > Add New' its not possible to create users with '.' in the name, but in Network Admin > Users > Add New its possible...

(normal) wp-includes/ms-functions.php

function wpmu_validate_user_signup($user_name, $user_email) {
	preg_match( '/[a-z0-9]+/', $user_name, $maybe );
Only lowercase letters (a-z) and numbers are allowed.

(network) wp-admin/network/user-new.php
dont have any regexp...

Attachments (1)

17239.diff (1.9 KB) - added by sorich87 4 years ago.
Use wpmu_validate_user_signup() in network/user-new.php

Download all attachments as: .zip

Change History (7)

comment:1 @scribu4 years ago

  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to 3.2

comment:2 @ocean904 years ago

Non-Multisite uses only sanitize_user with $strict = true and Multisite first uses wpmu_validate_user_signup.

I think dots aren't allowed because it's used for the site domain name too.

comment:3 @technosailor4 years ago

So which way do we want to standardize? Allowing dots or not?

comment:4 @ryan4 years ago

Not allowing dots is a holdover from when the user name and domain were one and the same. That said, for now let's make network/user-new.php use wpmu_validate_user_signup(). In a later release we can drop the dot stripping.

@sorich874 years ago

Use wpmu_validate_user_signup() in network/user-new.php

comment:5 @sorich874 years ago

  • Keywords has-patch added; needs-patch removed

comment:6 @ryan4 years ago

  • Owner set to ryan
  • Resolution set to fixed
  • Status changed from new to closed

In [18131]:

Make user validation when adding a user via network admin consistent with adding a user elsewhere. Provide better feedback for validation problems. Props sorich87. fixes #17239

Note: See TracTickets for help on using tickets.