فهرست منبع

Fix #398: Validate `data.errorkeys` more correctly

Kartik Visweswaran 9 سال پیش
والد
کامیت
aa2494bced
3فایلهای تغییر یافته به همراه4 افزوده شده و 3 حذف شده
  1. 1 0
      CHANGE.md
  2. 3 3
      js/fileinput.js
  3. 0 0
      js/fileinput.min.js

+ 1 - 0
CHANGE.md

@@ -19,6 +19,7 @@ Change Log: `bootstrap-fileinput`
 12. (enh #390): Thumbnail error display enhancements.
 13. (enh #391): Thumbnail styling enhancements for flash, html, and object types.
 14. (enh #393): Minor enhancements to abort events before upload.
+15. (bug #398): Validate `data.errorkeys` more correctly.
 
 ## version 4.2.5
 

+ 3 - 3
js/fileinput.js

@@ -415,7 +415,7 @@
             }
         },
         isEmpty = function (value, trim) {
-            return value === null || value === undefined || value.length === 0 || (trim && $.trim(value) === '');
+            return value === undefined || value === null || value.length === 0 || (trim && $.trim(value) === '');
         },
         isArray = function (a) {
             return Array.isArray(a) || Object.prototype.toString.call(a) === '[object Array]';
@@ -1509,8 +1509,8 @@
                 }
             };
             fnSuccess = function (data, textStatus, jqXHR) {
-                var outData = self.getOutData(jqXHR, data), $thumbs = self.getThumbs(),
-                    keys = isEmpty(data.errorkeys) ? [] : data.errorkeys, key = 0;
+                var outData = self.getOutData(jqXHR, data), $thumbs = self.getThumbs(), key = 0;
+                    keys = isEmpty(data) || isEmpty(data.errorkeys) ? [] : data.errorkeys;
                 if (isEmpty(data) || isEmpty(data.error)) {
                     self.raise('filebatchuploadsuccess', [outData]);
                     setAllUploaded();

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
js/fileinput.min.js


برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است