commit 6a629490b3e00a72249af23e8752a5cda6e5eb3a
parent 4bc7ab90167699fdc66eb9d0d5b184bb9fa2b824
Author: Dan Stillman <dstillman@zotero.org>
Date: Thu, 26 Aug 2010 21:34:44 +0000
- Fix an XML parsing error (due to trailing whitespace, weirdly) that could cause endless sync icon spinning
- Remove extra whitespace in collection-item blocks that was causing sync upload errors (also fixed on the server)
Diffstat:
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/chrome/content/zotero/xpcom/sync.js b/chrome/content/zotero/xpcom/sync.js
@@ -1351,8 +1351,10 @@ Zotero.Sync.Server = new function () {
_error(response.firstChild.firstChild.nodeValue);
}
+ var xml = Zotero.Utilities.prototype.trim(xmlhttp.responseText.replace(/<\?xml.*\?>\s*/, ''));
+
// Strip XML declaration and convert to E4X
- var xml = new XML(xmlhttp.responseText.replace(/<\?xml.*\?>/, ''));
+ xml = new XML(xml);
try {
var updateKey = xml.@updateKey.toString();
@@ -3741,7 +3743,7 @@ Zotero.Sync.Server.Data = new function() {
xml.collections + ' ' + child.id : child.id;
}
else */if (child.type == 'item') {
- xml.items = xml.items ?
+ xml.items = xml.items.toString() ?
xml.items + ' ' + child.key : child.key;
}
}