diff --git a/chrome/content/zotero/xpcom/attachments.js b/chrome/content/zotero/xpcom/attachments.js index b5909b609c..19378d7bb2 100644 --- a/chrome/content/zotero/xpcom/attachments.js +++ b/chrome/content/zotero/xpcom/attachments.js @@ -51,12 +51,7 @@ Zotero.Attachments = new function(){ Zotero.debug('Importing attachment from file'); // Try decoding URI entities, since we're going to strip '%' - var newName = file.leafName; - try { - newName = decodeURIComponent(file.leafName); - } - catch (e) {} - newName = Zotero.File.getValidFileName(newName); + var newName = Zotero.File.getValidFileName(file.leafName); if (!file.isFile()) { throw ("'" + file.leafName + "' must be a file in Zotero.Attachments.importFromFile()"); diff --git a/chrome/content/zotero/xpcom/file.js b/chrome/content/zotero/xpcom/file.js index 3e98deef53..9ad7eec4e6 100644 --- a/chrome/content/zotero/xpcom/file.js +++ b/chrome/content/zotero/xpcom/file.js @@ -360,7 +360,7 @@ Zotero.File = new function(){ function getValidFileName(fileName, skipXML) { // TODO: use space instead, and figure out what's doing extra // URL encode when saving attachments that trigger this - fileName = fileName.replace(/[\/\\\?%\*:|"<>]/g, ''); + fileName = fileName.replace(/[\/\\\?\*:|"<>]/g, ''); // Replace newlines and tabs (which shouldn't be in the string in the first place) with spaces fileName = fileName.replace(/[\r\n\t]+/g, ' '); // Replace various thin spaces