WordPress.org

Ready to get started?Download WordPress

Forums

WP-PhpBB Bridge: special characters in username (4 posts)

  1. Luca D.
    Member
    Posted 3 years ago #

    Hi, I'm an italian user.

    I saw that nickname was protected by an ereg_replace.
    If I use a simply htmlspecialchars I must deactive the plugin before and the re-active it? I had worked only on MyBB and with wordpress I'm a little bit scared :)
    This is the site: http://ficw.altervista.org

    Thank you.

  2. Luca D.
    Member
    Posted 3 years ago #

    I did it, but it is not changed.
    The username in PhpBB for example is: [ex]hello ; [ex]hello1 and in WP is: exhello and exhello1
    The same happens to uppercase, changed in lowercase, for example: [ex]Luca in exluca

    This is the part of code that I modifyed:

    function wpb_get_username($count = 0)
    {
    	global $user;
    
    	$new_username = htmlspacialchars($user->data['username']);
    
    	if($count > 0)
    	{
    		$new_username .= (string)$count;
    	}
    
    	if(username_exists($new_username))
    	{
    		$count++;
    		$new_username = wpb_get_username($count);
    	}
    
    	return $new_username;
    }

    Maybe I must modify formatting.php, the sanitize_user function? Which are the risks if I'm going to insert a simply htmlspecialchars?

  3. Luca D.
    Member
    Posted 3 years ago #

    Up please

  4. Luca D.
    Member
    Posted 3 years ago #

    Up

Topic Closed

This topic has been closed to new replies.

About this Topic