diff --git a/chrome/content/zotero/xpcom/storage.js b/chrome/content/zotero/xpcom/storage.js index c2cde12672..e3a2bdd43b 100644 --- a/chrome/content/zotero/xpcom/storage.js +++ b/chrome/content/zotero/xpcom/storage.js @@ -1111,6 +1111,7 @@ Zotero.Sync.Storage = new function () { Components.utils.reportError(msg + " in " + funcName); continue; } + try { destFile.create(Components.interfaces.nsIFile.NORMAL_FILE_TYPE, 0644); } @@ -1234,6 +1235,20 @@ Zotero.Sync.Storage = new function () { } catch (e) { Zotero.debug(destFile.path); + + // For advertising junk files, ignore a bug on Windows where + // destFile.create() works but zipReader.extract() doesn't + // when the path length is close to 255. + if (destFile.leafName.match(/[a-zA-Z0-9]{130,}/)) { + var msg = "Ignoring error extracting '" + destFile.path + "'"; + Zotero.debug(msg, 2); + Zotero.debug(e, 2); + Components.utils.reportError(msg + " in " + funcName); + continue; + } + + zipReader.close(); + Zotero.File.checkFileAccessError(e, destFile, 'create'); }