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.

Does not work on user names with spaces

LeeHLeeH
edited March 2012 in Vanilla 2.0 - 2.8

When using bbcode, the plugin does not appear to work on user names with spaces in them. They show up as text in the comment, like this:

[quote="Name With Spaces"] quoted text

Any ideas for a quick workaround?

Best Answer

  • 422422 MVP
    Answer ✓

    Just so you know, i am watching this thread with interest. Thanks for updates :)

    There was an error rendering this rich post.

Answers

  • Observation--the plugin appears to be picking up the username correctly, since clicking the "Quote" button correctly produces the quote in the comment box prior to posting. This works whether or not the user name has a space.

    After a bit of poking around, I believe the real issue is with the ValidateUsernameRegex not understanding that usernames can have spaces. My grasp of regex syntax is horrible, but I'll poke at it and see if this is indeed where the problem is and, if so, I'll try to fix it.

  • LeeHLeeH
    edited March 2012

    Ah! Success!

    The fix was to modify class.quotes.plugin.php. On line 111, I changed this:

    C('Garden.User.ValidationRegex',"\d\w_"));

    ...to this:

    CC('Garden.User.ValidationRegex',"\d\w_\s"));

    Quotes now work correctly with usernames with spaces. It looks like the "\s" operator is kind of a catchall and there's probably a more targeted solution, but this works well enough to continue my Vanilla test & eval :)

  • Final comment--I also just realized that it's impossible to actually register user names with spaces. The account in question was created through the console, which allows spaces in the name field. I didn't actually realize spaces weren't allowed, so I'll make sure to fix the account name before rolling into production!

  • 422422 MVP
    Answer ✓

    Just so you know, i am watching this thread with interest. Thanks for updates :)

    There was an error rendering this rich post.

Sign In or Register to comment.