Allow spaces and numbers in usernames, at least while we're doing forum-based authentication

This commit is contained in:
Dan Stillman 2008-07-07 15:49:12 +00:00
parent 6e7bfe413e
commit e7cea2ebc8

View File

@ -513,10 +513,11 @@ Zotero.Sync.Server = new function () {
if (!username) {
_error("Username not set in Zotero.Sync.Server.login()");
}
else if (!username.match(/^\w+$/)) {
else if (!username.match(/^[\w\d ]+$/)) {
_error("Invalid username '" + username + "' in Zotero.Sync.Server.login()");
}
username = encodeURIComponent(Zotero.Sync.Server.username);
var password = encodeURIComponent(Zotero.Sync.Server.password);
var body = _apiVersionComponent
+ "&username=" + username