WordPress.org

Ready to get started?Download WordPress

Forums

username invalid (1 post)

  1. chabo
    Member
    Posted 8 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic