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

Fixed Can't tag a user with \\ in front of their name

Discussion in 'Resolved Bug Reports' started by Steve F, Mar 1, 2014.

  1. Steve F

    Steve F Well-Known Member

    Not sure if it happens on other things as well but we have a user with \\ in front of their name and we can't tag them, name does not come up in the preview either. We changed the users name to just have 1 '\' but we still can't tag them.
     
  2. Amaury

    Amaury Well-Known Member

    Do you know of any members here with slashes? I can test it and see if I can confirm it.
     
  3. Steve F

    Steve F Well-Known Member

  4. Amaury

    Amaury Well-Known Member

    Testing. @\\\zz\xa

    Confirmed.
     
  5. imthebest

    imthebest Formerly Super120

    @\\\zz\xa

    Confirmed, too.
     
  6. TheBigK

    TheBigK Well-Known Member

    One of our users's Id is [Prototype] and he doesn't appear in the @ suggestions.
     
  7. Mike

    Mike XenForo Developer Staff Member

    Fixed now. Looks like a bug with the actual look up -- this is a place where we needed to double escape backslashes.

    Regarding @[name here] type matches, they create an ambiguity with BB codes so they can't be tagged. That's generally as designed (it mostly just applies if their name starts with a "[").
     
    Amaury and Steve F like this.
  8. Steve F

    Steve F Well-Known Member


    Could you share the fix @Mike? If it is easy enough to do.

    Thanks!
     
  9. Mike

    Mike XenForo Developer Staff Member

    In library/XenForo/Db.php, change:
    Code:
    $string = str_replace(array('%', '_'), array('\\%', '\\_'), $string);
    to:
    Code:
    $string = str_replace(array('\\', '%', '_'), array('\\\\', '\\%', '\\_'), $string);
     
    Last edited: Mar 5, 2014
    Steve F likes this.

Share This Page