From e7cea2ebc8cf65ddf5414a2630d913fdbd1b75fc Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Mon, 7 Jul 2008 15:49:12 +0000 Subject: [PATCH] Allow spaces and numbers in usernames, at least while we're doing forum-based authentication --- chrome/content/zotero/xpcom/sync.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/sync.js b/chrome/content/zotero/xpcom/sync.js index 701b51f10..f254c5c50 100644 --- a/chrome/content/zotero/xpcom/sync.js +++ b/chrome/content/zotero/xpcom/sync.js @@ -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