prevent fileSelector from overwriting name param

This commit is contained in:
jessop 2019-12-20 11:44:52 -05:00 committed by Sean Yesmunt
parent a43d91504f
commit 4871973f88
2 changed files with 2 additions and 2 deletions

View file

@ -53,7 +53,7 @@ function PublishFile(props: Props) {
filePath: file.path || file, filePath: file.path || file,
}; };
// Strip off extention and replace invalid characters // Strip off extention and replace invalid characters
let fileName = file.name.substr(0, file.name.lastIndexOf('.')) || file.name; let fileName = name || file.name.substr(0, file.name.lastIndexOf('.')) || file.name;
let INVALID_URI_CHARS = new RegExp(regexInvalidURI, 'gu'); let INVALID_URI_CHARS = new RegExp(regexInvalidURI, 'gu');
let parsedFileName = fileName.replace(INVALID_URI_CHARS, '-'); let parsedFileName = fileName.replace(INVALID_URI_CHARS, '-');
if (!isStillEditing) { if (!isStillEditing) {