Parcourir la source

Fix #43: Validate special characters in filename before rendering caption

Kartik Visweswaran il y a 10 ans
Parent
commit
ec7d88eedb
2 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. 1 1
      js/fileinput.js
  2. 0 0
      js/fileinput.min.js

+ 1 - 1
js/fileinput.js

@@ -624,7 +624,7 @@
             readFile(0);
         },
         slug: function (text) {
-            return isEmpty(text) ? '' : text.replace(/[^\w-. ]+/g,'');
+            return isEmpty(text) ? '' : text.split(/(\\|\/)/g).pop().replace(/[^\w-.\\\/ ]+/g,'');
         },
         change: function (e) {
             var self = this, $el = self.$element, label = self.slug($el.val()),

Fichier diff supprimé car celui-ci est trop grand
+ 0 - 0
js/fileinput.min.js


Certains fichiers n'ont pas été affichés car il y a eu trop de fichiers modifiés dans ce diff