isRenameAllowedForType(): Handle empty autoRenameFiles.fileTypes
Previously, an empty value for the pref would be treated as matching *every* MIME type, because s.startsWith('') is true for any string. That meant that unchecking all the file type checkboxes would actually enable renaming for all files.
This commit is contained in:
parent
61d6ef8d3d
commit
aab90527ec
1 changed files with 3 additions and 2 deletions
|
@ -2479,8 +2479,9 @@ Zotero.Attachments = new function () {
|
|||
this.isRenameAllowedForType = function (contentType) {
|
||||
let typePrefixes;
|
||||
try {
|
||||
typePrefixes = (Zotero.Prefs.get('autoRenameFiles.fileTypes') || '')
|
||||
.split(',');
|
||||
let prefValue = Zotero.Prefs.get('autoRenameFiles.fileTypes');
|
||||
if (!prefValue) return false;
|
||||
typePrefixes = prefValue.split(',');
|
||||
}
|
||||
catch (e) {
|
||||
typePrefixes = [];
|
||||
|
|
Loading…
Reference in a new issue