diff --git a/chrome/content/zotero/overlay.js b/chrome/content/zotero/overlay.js
index 6f557dff90..c27a483ec2 100644
--- a/chrome/content/zotero/overlay.js
+++ b/chrome/content/zotero/overlay.js
@@ -1682,7 +1682,8 @@ var ZoteroPane = new function()
loadReport: 12,
sep4: 13,
recognizePDF: 14,
- reindexItem: 15
+ renameAttachments: 15,
+ reindexItem: 16
};
var menu = document.getElementById('zotero-itemmenu');
@@ -1737,12 +1738,33 @@ var ZoteroPane = new function()
else {
hide.push(m.recognizePDF);
}
- if (canIndex || canRecognize) {
+
+
+ // If all items are child attachments, show rename option
+ var canRename = true;
+ for (var i=0; i
+
diff --git a/chrome/content/zotero/xpcom/attachments.js b/chrome/content/zotero/xpcom/attachments.js
index 8a826fc3cf..8d825e52cd 100644
--- a/chrome/content/zotero/xpcom/attachments.js
+++ b/chrome/content/zotero/xpcom/attachments.js
@@ -926,9 +926,7 @@ Zotero.Attachments = new function(){
formatString = rpl('year');
formatString = rpl('title');
- // Strip potentially invalid characters
- // See http://en.wikipedia.org/wiki/Filename#Reserved_characters_and_words
- formatString = formatString.replace(/[\/\\\?\*:|"<>\.]/g, '');
+ formatString = Zotero.File.getValidFileName(formatString);
return formatString;
}