WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 2 years ago

#11753 closed defect (bug) (fixed)

3.0 upgrader needs to lowercase usernames

Reported by: Denis-de-Bernardy Owned by:
Milestone: 3.0 Priority: normal
Severity: major Version: 3.0
Component: General Keywords:
Focuses: multisite Cc:

Description

I'm opening this in advance so we don't forget. ms-default-filters.php has the following filter:

add_action ( 'sanitize_user', 'strtolower_usernames', 10, 3 );

after upgrading to 3.0, some users may end up wanting to turn their existing sites in a Multisite install. In the event this happens, we should:

  • fix the strtolower_usernames() function if needed (see #11751)
  • lowercase all usernames accordingly
  • double check that previous logins still work (they should work fine, see #5472)

Change History (13)

comment:1 @nacin5 years ago

  • Keywords multisite added

comment:2 @hakre5 years ago

regarding naming of a user see: #10319

comment:3 @nacin5 years ago

Just to update, this is now add_action ( 'sanitize_user', 'strtolower' ); as of [12948].

comment:4 @wpmuguru5 years ago

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

Usernames with uppercase letters and spaces can log in fine. I couldn't find any issues with either spaces or uppercase letters in the username.

comment:5 follow-up: @aaroncampbell4 years ago

Can we remove that filter then instead of adding a fix for WP->WPMS? Is there some place where MS is actually relying on a username being lowercase?

comment:6 in reply to: ↑ 5 ; follow-up: @Justin_K2 years ago

I'm wondering this too; is there any reason this filter is even needed? Upon enabling MS on a site with an existing (large) user table, suddenly switching case breaks the continuity of my user naming convention.

comment:7 in reply to: ↑ 6 ; follow-up: @nacin2 years ago

Replying to Justin_K:

I'm wondering this too; is there any reason this filter is even needed? Upon enabling MS on a site with an existing (large) user table, suddenly switching case breaks the continuity of my user naming convention.

We removed the lowercase requirements before 3.0 got released.

comment:8 in reply to: ↑ 7 ; follow-up: @Justin_K2 years ago

...But if the requirement isn't there, why is that filter applied to all multisite installs? (ms-default-filters.php, line 21 as of WP 3.5.1)

comment:9 in reply to: ↑ 8 ; follow-up: @nacin2 years ago

Replying to Justin_K:

...But if the requirement isn't there, why is that filter applied to all multisite installs? (ms-default-filters.php, line 21 as of WP 3.5.1)

You're right. You can open a new ticket if you think this should be removed, though I am guessing any changes will require quite a bit of research into the history and original reasoning of this.

comment:10 in reply to: ↑ 9 @Justin_K2 years ago

OK, thanks. And then in the interim at least, you're saying that you're essentially certain it's safe for me to just remove that filter?

comment:11 follow-up: @wpmuguru2 years ago

@Justin_K - You should test the conclusion you are drawing in a dev/test install before disabling the filter on your live install.

comment:12 in reply to: ↑ 11 @Justin_K2 years ago

Of course - but as a non-core-developer, there's always a very big chance that I wouldn't think of some corner-case reason for which something was implemented - which is why I was asking, "what's the purpose of this?" If the answer is simply "it's leftover from an old version and is no longer needed," then I'd trust my quick test that it's OK, but if the answer is "there were some complicated considerations that might not be readily apparent," then my testing on a dev site is unlikely to reveal whether or not it's safe to remove :P

comment:13 @duck_2 years ago

#17904 is an existing ticket about the extra multisite restrictions.

Note: See TracTickets for help on using tickets.