FIX: Image file names with dots were showing incorrectly in composer markdown (#8465)

When uploading an image file with dots in the filename we were splitting the string on dots and getting the last of the split items as the extension-less filename. However this did not work with filenames that have dots. We now  just remove the extension using substr.
This commit is contained in:
Martin Brennan
2019-12-06 10:58:47 +10:00
committed by GitHub
parent da2b0b2882
commit e4881290be
2 changed files with 20 additions and 13 deletions

View File

@@ -7,8 +7,7 @@ function isGUID(value) {
}
function imageNameFromFileName(fileName) {
const split = fileName.split(".");
let name = split[split.length - 2];
let name = fileName.substr(0, fileName.lastIndexOf("."));
if (isAppleDevice() && isGUID(name)) {
name = I18n.t("upload_selector.default_image_alt_text");