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.

Update for critical security issue in PHPMailer included in release Vanilla 2.3.1
Please upgrade to 2.3 here. The 2.2 and earlier branches are no longer being updated.

Does not work on user names with spaces

This discussion is related to the Quotes addon.
edited March 2012 in Vanilla 2.0 - 2.2

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:

  <blockquote class="UserQuote"><div class="QuoteAuthor"><a href="/profile/" rel="nofollow"></a> said:</div><div class="QuoteText"><p> quoted text

Any ideas for a quick workaround?

Best Answer


  • 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_")); this:


    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 Developer MVP
    Accepted Answer

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

    422 Real Estate Australia , now open Check it out

Sign In or Register to comment.