diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/presentation/MimeTypeUtils.java b/bbb-common-web/src/main/java/org/bigbluebutton/presentation/MimeTypeUtils.java index cee7ef4bb4..aa8a2d5277 100644 --- a/bbb-common-web/src/main/java/org/bigbluebutton/presentation/MimeTypeUtils.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/presentation/MimeTypeUtils.java @@ -44,8 +44,14 @@ public class MimeTypeUtils { }; public Boolean extensionMatchMimeType(String mimeType, String finalExtension) { - if(EXTENSIONS_MIME.containsKey(finalExtension.toLowerCase())) { - return EXTENSIONS_MIME.get(finalExtension.toLowerCase()).equalsIgnoreCase(mimeType); + if(EXTENSIONS_MIME.containsKey(finalExtension.toLowerCase()) && + EXTENSIONS_MIME.get(finalExtension.toLowerCase()).equalsIgnoreCase(mimeType)) { + return true; + } else if(EXTENSIONS_MIME.containsKey(finalExtension.toLowerCase() + 'x') && + EXTENSIONS_MIME.get(finalExtension.toLowerCase() + 'x').equalsIgnoreCase(mimeType)) { + //Exception for MS Office files named with old extension but using internally the new mime type + //e.g. a file named with extension `ppt` but has the content of a `pptx` + return true; } return false; diff --git a/bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/ApiController.groovy b/bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/ApiController.groovy index 346cba832a..9b3602ede6 100755 --- a/bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/ApiController.groovy +++ b/bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/ApiController.groovy @@ -45,7 +45,6 @@ import org.bigbluebutton.web.services.turn.RemoteIceCandidate import org.json.JSONArray import javax.servlet.ServletRequest -import java.util.regex.* class ApiController { private static final Integer SESSION_TIMEOUT = 14400 // 4 hours