1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Fixed Usernames not showing the letter "V" in them?

Discussion in 'Resolved Bug Reports' started by darren, Jan 13, 2014.

  1. darren

    darren Member

    I've disabled addons in the config.php so I can't see it being an addon issue.

    A user just made an account with the letter "V" in and it just replaced it with a space so "glove" would be "glo e" for example.

    Any help would be greatly appreciate, "V" is not in the named letters from usernames btw.
     
  2. Jeremy

    Jeremy XenForo Moderator Staff Member

    What is your user name validation regex?
     
  3. Mike

    Mike XenForo Developer Staff Member

    A URL would help too.
     
  4. darren

    darren Member

    Sorry Jeremy, not sure what you mean by Regex?
     
  5. darren

    darren Member

    Code:
    http://myspain.es/community/members/foxesglo-e.3866/
    I've made an account up myself (in admin cp) and it does the same.
     
  6. Mike

    Mike XenForo Developer Staff Member

    Do you think you could submit a ticket via the customer area with FTP and ACP details?

    It looks like your PCRE doesn't have \v (vertical white space). This is the first time I've seen this though.
     
    RoyalRumble likes this.
  7. darren

    darren Member

    Done Mike and thank you.
     
  8. RoyalRumble

    RoyalRumble Active Member

    Same problem here! Will do as @Mike suggested.
     
  9. Mike

    Mike XenForo Developer Staff Member

    This is related to a 5+ years old PCRE install. You should probably contact your host about it. In general, it's preferable for PHP to be compiled with the built-in PCRE library (rather than the server version).
     
  10. Veer

    Veer Well-Known Member

    Same problem here too.
     
  11. Mike

    Mike XenForo Developer Staff Member

    The fix is to replace this code in library/XenForo/DataWriter/User.php:
    Code:
    $newName = preg_replace('/\v+/u', ' ', $username);
    if (is_string($newName))
    {
            $username = $newName;
    }
    
    With:
    Code:
    // if this matches, then \v isn't known (appears to be PCRE < 7.2) so don't strip
    if (!preg_match('/\v/', 'v'))
    {
            $newName = preg_replace('/\v+/u', ' ', $username);
            if (is_string($newName))
            {
                    $username = $newName;
            }
    }
    
     
    thedude, Veer and darren like this.
  12. Veer

    Veer Well-Known Member

    Thank you Mike, but my host has resolved this for me (without applying the fix above my post).
     

Share This Page