• Hello,

    This is only allowed – Only lowercase letters and numbers allowed

    How can I also allow capital letters?

    Thanks.

Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Author Brajesh Singh

    (@sbrajesh)

    Hi @terry789,
    I am sorry for the delayed reply.

    1. what kind of setup do you have.

    I will need the plugin to show correct message as it currently shows the restrictions imposed by multisite and not the normal WordPres.

    Please do know that it won’t prevent user’s from using any username. That is the job of WordPress. If the users are unable to register, you may want to look at the allow capital letters or similar plugin for username.

    Regards
    Brajesh

    Thread Starter terry789

    (@terry789)

    Hello @sbrajesh,

    I do not have a multisite but a basic wordpress installation.
    WordPress 4.9.1 – Buddypress 2.9.2

    I can also use uppercase letters without your plugin activated.

    There is, however, a check on the name. Myname – works – myname also works – but these can not be used side by side. Username has already been used. Ok fine.

    However, your plugin tells me that only lowercase letters may be used.

    I have modified the following in your source file to test:

    Changed this
    preg_match( "/[a-z0-9]+/", $user_name, $maybe );
    To this
    preg_match( "/[A-Za-z0-9]+/", $user_name, $maybe );

    Uppercase letters can now also be used and Myname – works – myname also works – and correct I get, Username has already been used.

    But for user convenience both forms can be used.

    Regards,
    Terry

    Thread Starter terry789

    (@terry789)

    Update:

    With the above adjustment – also plugin – BuddyPress Username Changer – works correct.

    Gday

    What file and what line was this found in. ?

    The Author should have made it easy like this in the first place

    Plugin Author Brajesh Singh

    (@sbrajesh)

    Plugin Author Brajesh Singh

    (@sbrajesh)

    I will also look into it a bit more and see if WordPress normal and multisite both now allow capital letters now.

    Will update the plugin accordingly.

    Thank you
    Brajesh

    That changed code provided above doesnt allow spaces, how do we fix that code ?

    https://prntscr.com/i2xc9m

    • This reply was modified 7 years, 2 months ago by jasonb4u2.
    Plugin Author Brajesh Singh

    (@sbrajesh)

    Please try this for now. I will release an update with almost similar code.

    Please change this

    
    if ( ! validate_username( $user_name ) || in_array( $user_name, ( array ) $illegal_names ) || ( isset( $maybe[0] ) && $user_name != $maybe[0] ) ) {
    			$error = __( 'Only lowercase letters and numbers allowed', 'bpdev-username-availability-checker' );
    		}
    
    

    to

    
    if ( ! validate_username( $user_name ) || in_array( $user_name, ( array ) $illegal_names )  ) {
    			$error = __( 'Only lowercase letters and numbers allowed', 'bpdev-username-availability-checker' );
    		}
    

    In the above case, we are not doing any extra checking and letting WordPress do it for us.

    This should allows all valid usernames to pass(which are allowed by WordPress).

    Regards
    Brajesh

    • This reply was modified 7 years, 2 months ago by Brajesh Singh. Reason: removed the extra )

    ahhhhhh, that code above broke my site, very dangerous

    Plugin Author Brajesh Singh

    (@sbrajesh)

    Ahh,
    I am very sorry. Are you able to use ftp? If yes, please change the code to this.

    
    if ( ! validate_username( $user_name ) || in_array( $user_name, ( array ) $illegal_names ) )  {
    	$error = __( 'Only lowercase letters and numbers allowed', 'bpdev-username-availability-checker' );
    }
    

    Alos, please do not copy from the email and the code will ne entity encoded.

    My above code had an extra ‘)’. I am sorry I missed that and it broke your site.

    Yep, ya got it, I reckon you should upload all that now, save others having misshaps and wondering this and wondering that

    Onya, nice one

    Plugin Author Brajesh Singh

    (@sbrajesh)

    Thank you. I am glad your site is back now.

    Yes, I will add it to the plugin and release by tomorrow(I am about to leave, was waiting to make sure your site got back).

    Regards
    Brajesh

    Cheers buddy, thanks for the awesomeness

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘How can I also allow capital letters?’ is closed to new replies.