Check ext length explicitly in createShortened when checking path length

This commit is contained in:
Dan Stillman 2014-09-18 17:32:45 -04:00
parent 2a986c8635
commit 48955c8983

View File

@ -354,7 +354,8 @@ Zotero.File = new function(){
let pathLength = pathByteLength - fileNameByteLength;
newLength -= pathLength;
if (newLength < 5) {
// Make sure there's a least 1 character of the basename left over
if (newLength - ext.length < 1) {
throw new Error("Path is too long");
}
}