Permalink
Browse files

Added support for UTF-8 nicks.

  • Loading branch information...
1 parent 32d875b commit 6fb807b2155db228deb34a062034c56441cf1c8e @scottgonzalez committed May 27, 2010
Showing with 3 additions and 3 deletions.
  1. +0 −1 TODO
  2. +2 −1 demo/web/js/client.js
  3. +1 −1 lib/session.js
View
@@ -1,4 +1,3 @@
-- support for UTF-8 nicks
- find a better router module
-- update relevant requests to POSTs
@@ -165,7 +165,8 @@ $(function() {
login.submit(function() {
var nick = $.trim($("#nick").val());
- if (!nick.length || /[^\w_\-^!]/.exec(nick)) {
+ // TODO: move the check into nodechat.js
+ if (!nick.length || !/^[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+$/.test(nick)) {
loginError("Invalid Nickname.");
return false;
}
View
@@ -2,7 +2,7 @@ function Session(nick) {
if (nick.length > 50) {
return;
}
- if (/[^\w_\-^!]/.exec(nick)) {
+ if (!/^[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+$/.test(nick)) {
return;
}

0 comments on commit 6fb807b

Please sign in to comment.