Allow for XML .prop files on WebDAV in the future

This commit is contained in:
Dan Stillman 2009-09-19 10:50:22 +00:00
parent 2e93767c81
commit ae52a05c3b

View file

@ -203,13 +203,26 @@ Zotero.Sync.Storage.Session.WebDAV.prototype._getStorageModificationTime = funct
Zotero.debug(req.responseText);
var mtime = req.responseText;
// No modification time set
if (!mtime) {
if (!req.responseText) {
callback(item, false);
return;
}
try {
var xml = new XML(req.responseText);
}
catch (e) {
var xml = null;
}
if (xml && xml.childNodes.length()) {
// TODO: other stuff, but this makes us forward-compatible
mtime = xml.mtime.toString();
}
else {
mtime = req.responseText;
}
var mdate = new Date(mtime * 1000);
callback(item, mdate);
});