Browse Source

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

Stephen Ficklin 7 years ago
parent
commit
a8605c6abc
1 changed files with 3 additions and 2 deletions
  1. 3 2
      tripal/theme/js/TripalUploader.js

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

@@ -127,8 +127,9 @@
       var url = options['url'];
       var url = options['url'];
       var self = this;
       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 allowed_types = this.tables[tname]['allowed_types'];
         var matches = file.name.match(/^.*\.(.+)$/);
         var matches = file.name.match(/^.*\.(.+)$/);
         if (!matches) {
         if (!matches) {