Explorar o código

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

Kartik Visweswaran %!s(int64=10) %!d(string=hai) anos
pai
achega
ec7d88eedb
Modificáronse 2 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      js/fileinput.js
  2. 0 0
      js/fileinput.min.js

+ 1 - 1
js/fileinput.js

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

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
js/fileinput.min.js


Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio