WordPress.org

Ready to get started?Download WordPress

Forums

Notify of username restrictions (6 posts)

  1. pjbursnall
    Member
    Posted 9 months ago #

    I've noticed on a few test sites I have setup (with varying plugins) that WP does not allow spaces in a username - but this is not notified during the registration page, is not prompted for correction during registration, and is not notified to the new user via email.

    So you can register with a space in your username but you'll never be able to sign in with it.

    Seems like a bit of a flaw to me?

    Any ideas on correcting this on existing installs would be welcome.

    Thanks,
    Paul.

  2. Tom Leger
    Member
    Posted 9 months ago #

    Hi Paul,

    WordPress does actually allow spaces in the username--as an admin you can go in and manually set a password and log in with that account. But, I am seeing that the registration emails aren't going through to that user (or the password reset emails, etc).

    I'm guessing that the space is breaking the function. Seems like a definite problem!

    Here's the codex for the function wp_new_user_notification:
    http://codex.wordpress.org/Function_Reference/wp_new_user_notification

    Here's a plugin that will disallow usernames with various characteristics of your choosing, including spaces: http://wordpress.org/plugins/restrict-usernames/

  3. pjbursnall
    Member
    Posted 9 months ago #

    Hi Tom,

    Like I say, I don't see any error telling the space isn't permitted, but WP automatically adds a hyphen in it's place - something a normal user would never know. Registration emails seem fine when I've tested this. WP is really appending the username without notification.

    I'll look at restricting characters I guess. Hopefully someone will pick this up in the next release.

    Thanks again,
    Paul.

  4. ClaytonJames
    Member
    Posted 9 months ago #

    I just registered a new user on one of my sites (3.7.1) using a name containing a space, and had no issues logging in with that user name. The email was also sent successfully, and the username and password in it were exactly as expected. Weird.

  5. Tom Leger
    Member
    Posted 9 months ago #

    Weird! I'm going to try to track down why that might be happening on my end. I did install a logging plugin to check to see if the mail was being sent, and it is. It's definitely not showing up in my email, either in the inbox or in spam, etc.

  6. pjbursnall
    Member
    Posted 9 months ago #

    I've been able to replicate my issue - the hyphen is only added in place of white space on a username when Buddypress is activated, and therefore handling the registration process.

    I have raised a ticket on the BP forum - http://buddypress.org/support/topic/whitespace-in-username/

    I'm not sure what's going on with your registration emails Tom?

    Paul.

Reply

You must log in to post.

About this Topic