Browse Source

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

Kartik Visweswaran 10 năm trước cách đây
mục cha
commit
ec7d88eedb
2 tập tin đã thay đổi với 1 bổ sung1 xóa
  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()),

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
js/fileinput.min.js


Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác