commit 42c55ee5f3afd1cbf6d14e361bc415e8a74f2a87
parent 64f77108775d753baf2b38d6eb917f008bb5e3e5
Author: Dan Stillman <dstillman@zotero.org>
Date: Mon, 16 Feb 2015 17:26:51 -0500
Fix file sync error with filenames containing slashes
These shouldn't exist, but something either didn't used to or still isn't
protecting against them, so strip them in getFile().
Diffstat:
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/chrome/content/zotero/xpcom/data/item.js b/chrome/content/zotero/xpcom/data/item.js
@@ -2836,7 +2836,10 @@ Zotero.Item.prototype.getFile = function(row, skipExistsCheck) {
// accidentally use the parent dir. Syncing to OS X, which doesn't
// exhibit this bug, will properly correct such filenames in
// storage.js and propagate the change
- if (Zotero.isWin) {
+ //
+ // The one exception on other platforms is '/', which is interpreted
+ // as a directory by setRelativeDescriptor, so strip in that case too.
+ if (Zotero.isWin || path.indexOf('/') != -1) {
path = Zotero.File.getValidFileName(path, true);
}
var file = Zotero.Attachments.getStorageDirectory(this.id);