WordPress.org

Make WordPress Core

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#3531 closed defect (bug) (fixed)

Username with special Characters

Reported by: killer-g Owned by:
Milestone: 2.1 Priority: normal
Severity: major Version: 2.1
Component: Administration Keywords: username
Focuses: Cc:

Description

In older Versions it was allowed to have a Username with special characters. f.ex. MP:George

After updating to beta1 version i wanted to change some settings in the userprofile but this does not save since the username is checked again.

Solution:

when editing my existing userprofile there is no need to check the username before saving since i can´t change it anyway

In admin_function.php around line 500 wrap if(!validate_username).. with if like the following:

if($update==false){
 if ( !validate_username( $user->user_login ) )
        $errors->add( 'user_login', __( '<strong>ERROR</strong>: This username is invalid.  Please enter a valid username.' ));
}

Change History (4)

#1 follow-up: @markjaquith
10 years ago

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

(In [4693]) Don't re-validate the username when updating the profile (as it can't be edited anyway). Props killer-g. fixes #3531

#2 in reply to: ↑ 1 ; follow-up: @Viper007Bond
10 years ago

Replying to markjaquith:

as it can't be edited anyway

Because of PHP or because the field is set as disabled? A disabled field is hardly a block from changing the username. Hell, I have an extension in Firefox that'll do just that.

#3 in reply to: ↑ 2 @markjaquith
10 years ago

Replying to Viper007Bond:

Because of PHP or because the field is set as disabled? A disabled field is hardly a block from changing the username. Hell, I have an extension in Firefox that'll do just that.

Because of PHP. wp_update_user() in update mode doesn't touch the user_login.

#4 @Viper007Bond
10 years ago

Gotcha. Excellent then. :)

Note: See TracTickets for help on using tickets.