pepyatka / pepyatka-server

Server for Pepyatka
79 stars 27 forks source link

[Verified] User can create group with non-latin username #226

Closed davidmz closed 9 years ago

davidmz commented 9 years ago

Example: https://micropeppa.freefeed.net/микрогруппа

epicmonkey commented 9 years ago

Same for usernames. I agree only latin and underscore are allowed (pretty much the same as in Twitter). UPD: http://stackoverflow.com/a/6351873

davidmz commented 9 years ago

I remembered that in old FrF hyphen (-) was permitted too (in groupname 'save-our-snobs', for example).

epicmonkey commented 9 years ago

Good catch! I guess group could start with an underscore, however not with a hyphen?

davidmz commented 9 years ago

There are no usernames/groupnames with underscore in my personal FrF backup (my friends and some other users/groups). Moreover, there is no single USERnames with hyphens, hyphens are present only in groupnames. Maybe we should check the Clio archives?

smallq-git commented 9 years ago

"-" replaced any spaces entered in username. No special characters were permitted.

epicmonkey commented 9 years ago

Let me know if tests are missing anything:

Group
 #isValidUsername ()
  ✓ should allow username luna
  ✓ should allow username 12345
  ✓ should allow username hello1234
  ✓ should allow username save-our-snobs
  ✓ should not allow invalid username lu
  ✓ should not allow invalid username -12345
  ✓ should not allow invalid username luna-
  ✓ should not allow invalid username hel--lo
  ✓ should not allow invalid username абизьян

User
 #isValidUsername ()
  ✓ should allow username luna (93ms)
  ✓ should allow username 12345 (84ms)
  ✓ should allow username hello1234 (79ms)
  ✓ should not allow invalid username lu
  ✓ should not allow invalid username -12345
  ✓ should not allow invalid username luna-
  ✓ should not allow invalid username hel--lo
  ✓ should not allow invalid username save-our-snobs
  ✓ should not allow invalid username абизьян
smallq-git commented 9 years ago

Group name autogeneration: https://github.com/pepyatka/pepyatka-html/issues/448