Ver código fonte

Updates to release v4.5.0 fix #1290

Kartik Visweswaran 6 anos atrás
pai
commit
4b73af3f54
3 arquivos alterados com 8 adições e 2 exclusões
  1. 3 0
      CHANGE.md
  2. 5 2
      js/fileinput.js
  3. 0 0
      js/fileinput.min.js

+ 3 - 0
CHANGE.md

@@ -5,8 +5,11 @@ Change Log: `bootstrap-fileinput`
 
 **Date:** _work in process_
 
+- (enh #1290): Enhance `htmlEncode` to parse undefined variables.
+- (enh #1288): Update Dutch Translations.
 - (enh #1287): Correct full screen modal styling.
 - (enh #1286): Default `autoOrientImage` to `false`.
+- (enh #1285): Update Danish Translations.
 - (bug #1282): Allow `filebrowse` event to be prevented.
 - (enh #1279): Enhance `usePdfRenderer` callback check to detect android phones.
 - Correct nuget batch file.

+ 5 - 2
js/fileinput.js

@@ -336,7 +336,10 @@
         uniqId: function () {
             return Math.round(new Date().getTime()) + '_' + Math.round(Math.random() * 100);
         },
-        htmlEncode: function (str) {
+        htmlEncode: function (str, undefVal) {
+            if (str === undefined) {
+                return undefVal || null;
+            }
             return str.replace(/&/g, '&')
                 .replace(/</g, '&lt;')
                 .replace(/>/g, '&gt;')
@@ -3815,7 +3818,7 @@
                     return;
                 }
                 if (caption.length === 0) {
-                    msg = self.msgInvalidFileName.replace('{name}', $h.htmlEncode(file.name));
+                    msg = self.msgInvalidFileName.replace('{name}', $h.htmlEncode(file.name, '[unknown]'));
                     throwError(msg, file, previewId, i);
                     return;
                 }

Diferenças do arquivo suprimidas por serem muito extensas
+ 0 - 0
js/fileinput.min.js


Alguns arquivos não foram mostrados porque muitos arquivos mudaram nesse diff