Browse Source

Fix #1617: Better encoded file id generation

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

+ 1 - 0
CHANGE.md

@@ -5,6 +5,7 @@ Change Log: `bootstrap-fileinput`
 
 **Date**: _under development_
 
+- (enh #1617): Better encoded file id generation.
 - (enh #1612, #1614): Remove unsupported script-inline from template and CSP buffer.
 
 ## version 5.1.2

+ 1 - 1
js/fileinput.js

@@ -111,7 +111,7 @@
             if (!relativePath) {
                 return null;
             }
-            return (file.size + '_' + relativePath.replace(/\s/img, '_'));
+            return (file.size + '_' + encodeURIComponent(relativePath).replace(/%/g, '_'));
         },
         getFrameSelector: function (id, selector) {
             selector = selector || '';

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