commit d1d70d3df8546a94e8dab0ab59346d3e33b97788
parent 37e4d8962ebda79c86273f0873d4f07a62499824
Author: Dan Stillman <dstillman@zotero.org>
Date: Wed, 16 Dec 2009 00:06:53 +0000
Automatically delete .prop files that don't contain valid timestamps
Diffstat:
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/chrome/content/zotero/xpcom/storage/webdav.js b/chrome/content/zotero/xpcom/storage/webdav.js
@@ -225,6 +225,16 @@ Zotero.Sync.Storage.Session.WebDAV.prototype._getStorageModificationTime = funct
mtime = req.responseText;
}
+ // Delete invalid .prop files
+ if (!(mtime + '').match(/^[0-9]{10}$/)) {
+ var msg = "Invalid mod date '" + Zotero.Utilities.prototype.ellipsize(mtime, 20)
+ + "' for item " + Zotero.Items.getLibraryKeyHash(item) + " in " + funcName;
+ Zotero.debug(msg, 1);
+ self._deleteStorageFiles([item.key + ".prop"], null, self);
+ self.onError(msg);
+ return;
+ }
+
var mdate = new Date(mtime * 1000);
callback(item, mdate);
});
@@ -289,12 +299,6 @@ Zotero.Sync.Storage.Session.WebDAV.prototype.downloadFile = function (request) {
try {
var syncModTime = Zotero.Date.toUnixTimestamp(mdate);
- if (!syncModTime) {
- var msg = "Invalid mod date '" + mdate + "' for item "
- + Zotero.Items.getLibraryKeyHash(item) + " in " + funcName;
- Zotero.debug(msg, 1);
- throw (msg);
- }
// Skip download if local file exists and matches mod time
var file = item.getFile();