Quellcode durchsuchen

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

Stephen Ficklin vor 7 Jahren
Ursprung
Commit
a8605c6abc
1 geänderte Dateien mit 3 neuen und 2 gelöschten Zeilen
  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) {