Browse Source

Fix #758: Correct file slug name parsing for an invalid file extension

Kartik Visweswaran 8 years ago
parent
commit
d540f7b823
3 changed files with 4 additions and 3 deletions
  1. 2 1
      CHANGE.md
  2. 2 2
      js/fileinput.js
  3. 0 0
      js/fileinput.min.js

+ 2 - 1
CHANGE.md

@@ -3,13 +3,14 @@ Change Log: `bootstrap-fileinput`
 
 
 ## version 4.3.5 (under development)
 ## version 4.3.5 (under development)
 
 
-**Date:** 09-Sep-2016
+**Date:** 16-Sep-2016
 
 
 1. (bug #734): Correct right parsing of `fileuploaded` event params.
 1. (bug #734): Correct right parsing of `fileuploaded` event params.
 2. (enh #736): Update Portugese Brazilian Translations.
 2. (enh #736): Update Portugese Brazilian Translations.
 3. (enh #741): Update Vietnamese Translations.
 3. (enh #741): Update Vietnamese Translations.
 4. (enh #745): Update Russian Translations.
 4. (enh #745): Update Russian Translations.
 5. (bug #753): Correct IE11 file clear bug when using without ajax.
 5. (bug #753): Correct IE11 file clear bug when using without ajax.
+6. (bug #758): Correct file slug name parsing for an invalid file extension.
 
 
 ## version 4.3.4
 ## version 4.3.4
 
 

+ 2 - 2
js/fileinput.js

@@ -2187,8 +2187,8 @@
                     return;
                     return;
                 }
                 }
                 var node = ctr + i, previewId = previewInitId + "-" + node, isText, isImage, file = files[i],
                 var node = ctr + i, previewId = previewInitId + "-" + node, isText, isImage, file = files[i],
-                    caption = self.slug(file.name), fileSize = (file.size || 0) / 1000, checkFile, fileExtExpr = '',
-                    previewData = objUrl.createObjectURL(file), fileCount = 0, j, msg, typ, chk,
+                    caption = file.name ? self.slug(file.name) : '', fileSize = (file.size || 0) / 1000, checkFile,
+                    fileExtExpr = '', previewData = objUrl.createObjectURL(file), fileCount = 0, j, msg, typ, chk,
                     fileTypes = self.allowedFileTypes, strTypes = isEmpty(fileTypes) ? '' : fileTypes.join(', '),
                     fileTypes = self.allowedFileTypes, strTypes = isEmpty(fileTypes) ? '' : fileTypes.join(', '),
                     fileExt = self.allowedFileExtensions, strExt = isEmpty(fileExt) ? '' : fileExt.join(', ');
                     fileExt = self.allowedFileExtensions, strExt = isEmpty(fileExt) ? '' : fileExt.join(', ');
                 if (!isEmpty(fileExt)) {
                 if (!isEmpty(fileExt)) {

File diff suppressed because it is too large
+ 0 - 0
js/fileinput.min.js


Some files were not shown because too many files changed in this diff