瀏覽代碼

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

Kartik Visweswaran 10 年之前
父節點
當前提交
ec7d88eedb
共有 2 個文件被更改,包括 1 次插入1 次删除
  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()),

文件差異過大導致無法顯示
+ 0 - 0
js/fileinput.min.js


部分文件因文件數量過多而無法顯示