Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Quotes Plugin fails on usernames with periods and spaces in 2.0.18.8

This discussion was created from comments split from: Quotes. Problem with User with . and space in user name.
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
0
Comments
I have just discovered this problem myself having upgraded to 2.0.18.8 It wasn't a problem before the upgrade from 2.0.17.? if that helps provide an answer. I've just instructed users to edit the user name in the post for now.
@hgtonight : can you split this one please? It's only a 3 year old topic that got necro posted
There was an error rendering this rich post.
Sorry Underdog,
When should I start a new topic on a subject that relates to an identical issue?
I did a search before starting a new discussion which is what I thought I should do.
Isn't hgtonight's post relevant? if only to show I'm not the only one with the problem?
Regards, confused of Liverpool
Firstly, I really appreciate you searching for your issues first. It really helps!
You need to consider the age of the old thread. Posting, as you did, on a three year
old thread is called necroposting.
In this case, creating a new topic and referencing the old thread would be best.
Lastly, the parsers tend to choke on usernames with unusual characters in names. Can you outline your specific issue and how to replicate it?
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
I think it goes back to Vanilla 1 when it was possible to join a forum using spaces in the user name. Users who have been with me since the early days and have a space in their name create this issue. I'll try and simulate it here but as I don't have edit privileges it has to work first time.
No didn't work what displays in my forum is the following:-
If user name has no spaces:-
If user name has spaces:-
........Firstly, I really appreciate you searching for your issues first. It really helps!
If I edit a users post the relevant html is shown and I only have to delete the space for it to show correctly.
Before my upgrade to 2.0.18.8 It wasn't a problem.
As this affected a handful of user names I've edited them and replaced spaces with an underscore. I of course emailed the affected members. Seemed like the simplest solution.
What's the status of this? Seems like everybody is just fixing the error by having people change usernames.
The issue is easy to replicate. Create a user which a period in the username. Then try to reference that username in a reply. You can't because it breaks on the period.
Is this not fixable?
Thanks
Good! So you created a bug report on github and the number is ...
There was an error rendering this rich post.
@UnderDog fyi, you guys are horrible moderators. If you put half as much effort into answering questions constructively as you do telling people what they're doing wrong, maybe these issues wouldn't be outstanding 3 years later.
Also, I looked at GitHub. I'm not even sure which project to submit the bug in and I'm sure I wouldn't do it to your standards so I won't even try.
>
Anything can be done in software. I can't imagine a high performance way to do it. The simplest solution is to only match usernames that actually exist. So replace the formatter with the following algorithm.
@
with a whitespace character in front@
matches@
matchWith this algorithm, you will hit on all valid usernames, but will require at least 2 regexs and a model request for every
@
sign in a post. Worst case scenario is someone posts an email address with a common start name as the domain. Imagine I have an email address likellcoolj@mrs.com
and you have 65 users with names that start asMrs.
. That is 66 user model searches for a single@
sign and it doesn't even result in a valid mention.There is definitely ways to optimize this, but it seems like a lot more effort than the current set up. To wit, here is the current mention detection algorithm:
@
signs with whitespace in front of it, some number of non-period and non whitespace characters after it, and link it as a mentionOne regex, some false positives, and some minor restrictions. Much better performance wise.
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
@hgtonight thank you! It sounds like the problem isn't an easy fix.
So I guess the status would be "not worth the effort to fix", or maybe it should be "disallow periods and white space".
Another thought would be to add support to the regex for wrapping names in quotes or some other special character.
In the mean time I guess I'll do the same as those before me and recommend we coordinate with the user on changing their username.
Also, just an FYI, I got here via a Google search so hopefully your reply will help those who come after me as well.
Thanks again!
If I were a horrible moderator, I would say something about this, but I won't.
Instead I wish you all the luck with the Solutions you will receive hereafter.
There was an error rendering this rich post.
I am sure the devs would accept a pull request containing a better mention parser. It just has to scale decently.
I did come up with a solution for usernames with spaces. You can replace the space with a plus and modify the regex slightly. I am on my phone so I can't look it up right now, but is here on the forums.
There was a discussion about using enclosing brackets for mentions with weird usernames, but that would require a horizontal code change affecting many products. Any ideas as far as markup?
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
@user name would be okay for me since my first PC was running DOS
So, is the problem here spaces, periods, or both? Unable to create spaces in names with current version, so were spaces in Vanilla 1 or other forums converted to periods, or are spaces in existing names allowed? The llcoolj@mrs.com address wouldn't pass rule 1 above too, so emails should be ok with that check. Spaces are allowed in emails too with quotes, so you can't rely on it alone. + is also allowed in an email before the @.
I think I like the @user name assuming a space before @ and that Vanilla usernames can't contain ". For an email to contain a " it must have a \ in front of it unless used to quote special chars, so no false positives there since the domain part after @ can't contain a ". @[user name] or @{user name} would have been even better, but rules in emails for those chars (IP can be in [] for domain) and spaces being allowed in quotes would make too many rules needed...although @{user name} might work since a domain can't contain them. The quotes should only need the one check.
The issue with mentions is the assumption that whitespace and periods are boundary characters and are not allowed in usernames. Since you can change the restrictions via configs and names returned by connect plugins aren't necessarily going to conform to these arbitrary restrictions, you have a disconnect.
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
Then you realise it's fashionable for newly married women to use both their old and new surnames together. So you have to consider people with two spaces in their name and your plans really go to pieces
With markers like a " they could have 100 spaces and it wouldn't matter as long as we don't get names containing a ". It was mentioned above about "Horizontal Code Changes" with a bracket/marker method. Are mentions processed every time they are shown (Seems like that would be slow on large threads), or when the comment/discussion is submitted and then stored as a mention link? If stored then previous mentions would still function with the change and new mentions would just need to use the new syntax.
It would be nice to have a popup as soon as the activator [space]@ is typed too with user names (Possibly after typing at least 2-3 chars of the name to limit the results) and when clicked it would insert the name and closing so you don't have much extra typing.