• Hi, I running WP 2.0.2

    I want to use username includes ‘-‘, but this username is invalid.

    sanitize_user in wp-include/functions-formatting.php return invalid.

    // If strict, reduce to ASCII for max portability.
    if ( $strict )
    $username = preg_replace(‘|[^a-z0-9 _.-@]|i’, ”, $username);

    ‘.-@’ in pattern means form ‘.’ to ‘@’, not includes ‘-‘.

    And WP 2.0 code is

    function sanitize_user( $username ) {
    return preg_replace(‘|a-z0-9 _.-|i’, ”, $username);
    }

    WP 2.0.2 code like WP 2.0 code add ‘@’.
    ‘-‘ doesn’t mean character range, means ‘\-‘ ?

    Bad English, Sorry.

  • The topic ‘username invalid’ is closed to new replies.