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