vanilla / vanilla

Vanilla is a powerfully simple discussion forum you can easily customize to make as unique as your community.
https://open.vanillaforums.com
GNU General Public License v2.0
2.89k stars 776 forks source link

Usernames do not allow unicode characters #1202

Closed Apreche closed 13 years ago

Apreche commented 13 years ago

I tried to make a username with unicode characters in it, and it didn't work. I even tried changing the validation regex to include \X, but that still didn't work. A user should be able to put ǜ in their username if they so desire.

lackofcheese commented 13 years ago

\X doesn't work because it can represent multiple Unicode code points instead of just one. You need to use syntax such as \p{L} for letters, and \p{M} for marks such as accents.

Personally, after some consideration, I suggest something along the lines of this:

$Configuration['Garden']['User']['ValidationRegex'] = '^\/\<">#@\'\p{Zl}\p{Zp}\p{C}';

which should allow all characters except the backslash, forward slash, less than sign, greater than sign, single quote, double quote, hash, at sign, all line breaks, all paragraph breaks, and all control/other characters.

linc commented 13 years ago

As @lackofcheese points out, you can override the regex with your own in the config.