users: don't allow Hangul filler characters in names.

Don't allow the following characters in names:

* https://codepoints.net/U+115F (HANGUL CHOSEONG FILLER)
* https://codepoints.net/U+1160 (HANGUL JUNGSEONG FILLER)
* https://codepoints.net/U+3164 (HANGUL FILLER)
* https://codepoints.net/U+FFA0 (HALFWIDTH HANGUL FILLER)

These are space-like characters that were inadvertently allowed because they're not considered
whitespace by Unicode and because they're in the Hangul script (which we otherwise allow).
This commit is contained in:
evazion
2022-12-05 23:54:33 -06:00
parent d157899226
commit dddd28a27b
2 changed files with 7 additions and 1 deletions

View File

@@ -219,6 +219,11 @@ class UserTest < ActiveSupport::TestCase
should_not allow_value("admin").for(:name)
should_not allow_value("mod").for(:name)
should_not allow_value("moderator").for(:name)
should_not allow_value("foo_\u115F").for(:name)
should_not allow_value("foo_\u1160").for(:name)
should_not allow_value("foo_\u3164").for(:name)
should_not allow_value("foo_\uFFA0").for(:name)
end
context "searching for users by name" do