Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Error message at Sign up page

  1. #1
    Thread Starter
    Veteran andreuerj's Avatar
    Join Date
    Jan 2012
    Location
    Brazil
    Posts
    1,666
    Thanks
    586
    Thanked 18 Times in 17 Posts

    Error message at Sign up page

    One user is trying to sign up at my site using the string "PEWM" at field "User", but the site show him the message bellow:

    <strong>ERROR</strong>: This username is invalid because it uses illegal characters. Please enter a valid username.

    What's going on? Is there a bug? Is related to Classipress or Wordpress WPMU?

    I'm using Wordpress WPMU 3.5.2, Classipress 3.3 and Advanced Custom Fields for ClassiPress.

  2. #2
    samcy's Avatar
    Join Date
    Mar 2012
    Location
    Germany
    Posts
    12,098
    Thanks
    121
    Thanked 1,756 Times in 1,442 Posts
    Hi andreuerj,

    I just tried to replicate this issue and used the same username PEWM on my test site. But i didn't have any problems to register and din't get that error message. So probably something else is causing this. Maybe a plugin or recently done change.

    Cheers
    Rolf Hassel (Samcy)

  3. #3
    Thread Starter
    Veteran andreuerj's Avatar
    Join Date
    Jan 2012
    Location
    Brazil
    Posts
    1,666
    Thanks
    586
    Thanked 18 Times in 17 Posts
    I'm not sure, but I think it started happening after upgrading Wordpress to multisite (WPMU). Is there a way to debug it to identify the problem? I deactivated all the plug-ins and the error still happens.

    I identified some lines of code that can be related to the problem:


    "wp-admin\includes\user.php"

    if ( !$update && isset( $_POST['user_login'] ) && !validate_username( $_POST['user_login'] ) )
    $errors->add( 'user_login', __( '<strong>ERROR</strong>: This username is invalid because it uses illegal characters. Please enter a valid username.' ));



    "public_html\wp-login.php"

    // Check the username
    if ( $sanitized_user_login == '' ) {
    $errors->add( 'empty_username', __( '<strong>ERROR</strong>: Please enter a username.' ) );
    } elseif ( ! validate_username( $user_login ) ) {
    $errors->add( 'invalid_username', __( '<strong>ERROR</strong>: This username is invalid because it uses illegal characters. Please enter a valid username.' ) );
    $sanitized_user_login = '';
    } elseif ( username_exists( $sanitized_user_login ) ) {
    $errors->add( 'username_exists', __( '<strong>ERROR</strong>: This username is already registered. Please choose another one.' ) );
    }



    "wp-content\themes\classipress\framework\includes\view s-login.php"

    // Check the username
    if ( $sanitized_user_login == '' ) {
    $errors->add( 'empty_username', __('<strong>ERROR</strong>: Please enter a username.', APP_TD) );
    } elseif ( ! validate_username( $posted['user_login'] ) ) {
    $errors->add( 'invalid_username', __('<strong>ERROR</strong>: This username is invalid because it uses illegal characters. Please enter a valid username.', APP_TD) );
    $sanitized_user_login = '';
    } elseif ( username_exists( $sanitized_user_login ) ) {
    $errors->add( 'username_exists', __('<strong>ERROR</strong>: This username is already registered, please choose another one.', APP_TD) );
    }

  4. #4
    Thread Starter
    Veteran andreuerj's Avatar
    Join Date
    Jan 2012
    Location
    Brazil
    Posts
    1,666
    Thanks
    586
    Thanked 18 Times in 17 Posts
    The line of code blocking the sign up is inside "wp-content\themes\classipress\framework\includes\view s-login.php".

    So, it's related to classipress. But why is it blocking?
    The error message is not clear enough to let the users understand why.

    After the following change at the source code, the user could sign up. But the change was only to identify the problem. So, I rolled back to the original code and now I'm asking for a fix.

    // Check the username
    if ( $sanitized_user_login == '' ) {
    $errors->add( 'empty_username', __('<strong>ERROR</strong>: Please enter a username.', APP_TD) );
    //} elseif ( ! validate_username( $posted['user_login'] ) ) {
    //$errors->add( 'invalid_username', __('<strong>ERROR</strong>: This username is invalid because it uses illegal characters. Please enter a valid username.', APP_TD) );
    //$sanitized_user_login = '';

    } elseif ( username_exists( $sanitized_user_login ) ) {
    $errors->add( 'username_exists', __('<strong>ERROR</strong>: This username is already registered, please choose another one.', APP_TD) );
    }

  5. #5
    Thread Starter
    Veteran andreuerj's Avatar
    Join Date
    Jan 2012
    Location
    Brazil
    Posts
    1,666
    Thanks
    586
    Thanked 18 Times in 17 Posts
    Ohh my gosh! I made a test using the login "pewm" instead of "PEWM" and the sign up was successful! The error is related to uppercase letters in the registration proccess! It should not happen! In my opinion, the user should register himself without any problem when typing the login in upper case! And after the registration process, the login recorded in the database is in lower case! Login pewm, PEWM or PeWm should be interpreted as the same user!
    Last edited by andreuerj; July 19th, 2013 at 06:28 AM. Reason: I added more information

  6. #6
    Veteran bleem's Avatar
    Join Date
    Feb 2012
    Posts
    1,571
    Thanks
    103
    Thanked 205 Times in 180 Posts
    I agree.

    I have just tested this and have the exact same issue.

    cp3.3.1 wp3.5.2

    One plugin installed.

    I tried to register with username: BLEET

    Register

    • ERROR: This username is invalid because it uses illegal characters. Please enter a valid username.

  7. The Following User Says Thank You to bleem For This Useful Post:

    andreuerj (July 19th, 2013)

  8. #7
    Veteran bleem's Avatar
    Join Date
    Feb 2012
    Posts
    1,571
    Thanks
    103
    Thanked 205 Times in 180 Posts
    I found this function regarding a similar question else where on the net.


    function fixUsernameCase($username){ $username = strtolower($username); return true; } add_filter ( 'authenticate', 'fixUsernameCase', 10, 1 );

    Anyone know if this would work and where to put it?

    I believe this changes the uppercase to lowercase prior to database entry.

    Not sure though - experts help please?

  9. #8
    Thread Starter
    Veteran andreuerj's Avatar
    Join Date
    Jan 2012
    Location
    Brazil
    Posts
    1,666
    Thanks
    586
    Thanked 18 Times in 17 Posts
    So, I think you are not using wordpress multisite. Are you?
    Quote Originally Posted by samcy View Post
    Hi andreuerj,

    I just tried to replicate this issue and used the same username PEWM on my test site. But i didn't have any problems to register and din't get that error message. So probably something else is causing this. Maybe a plugin or recently done change.

    Cheers

  10. #9
    Veteran bleem's Avatar
    Join Date
    Feb 2012
    Posts
    1,571
    Thanks
    103
    Thanked 205 Times in 180 Posts
    This issue is now fixed by way of a plugin.

    And yes I am using both multisite and single install or wordpress.

    http://forums.appthemes.com/advanced...up-page-54667/

    Thanks to Artem for checking it for me and the guy who made it and me for finding it

  11. #10
    samcy's Avatar
    Join Date
    Mar 2012
    Location
    Germany
    Posts
    12,098
    Thanks
    121
    Thanked 1,756 Times in 1,442 Posts
    Which plugin was causing this? Maybe it will be good to know for others with the same problem.

    Cheers
    Rolf Hassel (Samcy)

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 3
    Last Post: January 3rd, 2013, 11:51 AM
  2. Cannot go back to previous page after getting error message.
    By guerrero in forum Report ClassiPress Bugs
    Replies: 2
    Last Post: February 18th, 2012, 10:15 PM
  3. Error message in admin page Please help!!
    By govna in forum Report ClassiPress Bugs
    Replies: 7
    Last Post: October 10th, 2011, 09:02 PM
  4. Edit Error Message 2nd Page
    By bateman10 in forum Help Using ClassiPress
    Replies: 4
    Last Post: June 22nd, 2010, 11:15 AM