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

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.
 
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 "[").
 
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 "[").


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

Thanks!
 
In library/XenForo/Db.php, change:
Code:
$string = str_replace(array('%', '_'), array('\\%', '\\_'), $string);
to:
Code:
$string = str_replace(array('\\', '%', '_'), array('\\\\', '\\%', '\\_'), $string);
 
Last edited:
Back
Top Bottom