Fork me on GitHub

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Try Vanilla Forums Cloud product

In this Discussion

Ready to contribute?

Amazing! Sign our contributors' agreement and then join us on GitHub.

Current release is 2.1.6 (21 Nov 2014).

Users who have not yet upgraded to 2.1 should get security release 2.0.18.14 (1 Nov 2014). We will stop providing these security releases to 2.0 at the end of this year.

Does not work on user names with spaces

LeeHLeeH
edited March 2012 in Vanilla 2.0 Help
This discussion is related to the Quotes addon.

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

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!

Sign In or Register to comment.