From 13d5d59b01a49e11a2336e23a9dd4d6261c87cff Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Sat, 24 Mar 2007 22:57:14 +0000 Subject: [PATCH] Strip potentially invalid characters in auto-generated attachment filenames --- chrome/content/zotero/xpcom/attachments.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/chrome/content/zotero/xpcom/attachments.js b/chrome/content/zotero/xpcom/attachments.js index af20f64a5..13713ef36 100644 --- a/chrome/content/zotero/xpcom/attachments.js +++ b/chrome/content/zotero/xpcom/attachments.js @@ -716,6 +716,9 @@ Zotero.Attachments = new function(){ // Title formatString = rpl('title', formatString); + // Strip potentially invalid characters + // See http://en.wikipedia.org/wiki/Filename#Reserved_characters_and_words + formatString = formatString.replace(/[\/\\\?\*:|"<>\.]/g, ''); return formatString; }