From cde028b0f2dc86beec56c11daa2c652250b5e593 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Fri, 18 Sep 2009 05:01:42 +0000 Subject: [PATCH] Fix for (rare, I would think) "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIFile.create]" file sync error --- chrome/content/zotero/xpcom/storage.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/chrome/content/zotero/xpcom/storage.js b/chrome/content/zotero/xpcom/storage.js index f044ae4e6a..d037632bfd 100644 --- a/chrome/content/zotero/xpcom/storage.js +++ b/chrome/content/zotero/xpcom/storage.js @@ -795,6 +795,11 @@ Zotero.Sync.Storage = new function () { continue; } + // Make sure the new filename is valid, in case an invalid character + // for this OS somehow make it into the ZIP (e.g., from before we checked + // for them or if a user manually renamed and relinked a file on another OS) + fileName = Zotero.File.getValidFileName(fileName); + Zotero.debug("Extracting " + fileName); var destFile = parentDir.clone(); destFile.QueryInterface(Components.interfaces.nsILocalFile);