Pārlūkot izejas kodu

Fixed a bug in the uploader when no allowed types were provided

Stephen Ficklin 7 gadi atpakaļ
vecāks
revīzija
a8605c6abc
1 mainītis faili ar 3 papildinājumiem un 2 dzēšanām
  1. 3 2
      tripal/theme/js/TripalUploader.js

+ 3 - 2
tripal/theme/js/TripalUploader.js

@@ -127,8 +127,9 @@
       var url = options['url'];
       var self = this;
       
-      // Make sure the file type is allowed
-      if (this.tables[tname]['allowed_types']) {
+      // Make sure the file type is allowed.  If there are no file types
+      // then anything is allowed.
+      if (this.tables[tname]['allowed_types'] && this.tables[tname]['allowed_types'].length > 0) {
         var allowed_types = this.tables[tname]['allowed_types'];
         var matches = file.name.match(/^.*\.(.+)$/);
         if (!matches) {