Ticket #3531 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

Username with special Characters

Reported by: killer-g Assigned to: anonymous
Priority: normal Milestone: 2.1
Component: Administration Version: 2.1
Severity: major Keywords: username
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

(follow-up: ↓ 2 ) 01/07/07 07:52:59 changed by markjaquith

  • status changed from new to closed.
  • resolution set to fixed.

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

(in reply to: ↑ 1 ; follow-up: ↓ 3 ) 01/07/07 13:33:39 changed by Viper007Bond

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.

(in reply to: ↑ 2 ) 01/07/07 13:41:40 changed by markjaquith

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.

01/07/07 13:46:15 changed by Viper007Bond

Gotcha. Excellent then. :)