fix: allow advertising images in managed uploads (#23547)
| | |
| | | } |
| | | |
| | | String getManageAllowedExt() { |
| | | return mergeAllowedExt(getAllowedExt(fileUploadConfig.getDocExt()), MANAGE_MEDIA_EXTENSIONS); |
| | | return mergeAllowedExt( |
| | | getAllowedExt(fileUploadConfig.getImageExt()), |
| | | getAllowedExt(fileUploadConfig.getDocExt()), |
| | | MANAGE_MEDIA_EXTENSIONS); |
| | | } |
| | | |
| | | static String mergeAllowedExt(String... extensionGroups) { |
| | |
| | | class FileControllerTest { |
| | | |
| | | @Test |
| | | void managementUploadAllowsConfiguredDocumentsAndFaqVideos() { |
| | | String allowed = FileController.mergeAllowedExt("png,jpg,pdf,doc,docx", "mp4,avi,rmvb,mov"); |
| | | void managementUploadAllowsConfiguredImagesDocumentsAndFaqVideos() { |
| | | String allowed = FileController.mergeAllowedExt("png,jpg", "pdf,doc,docx", "mp4,avi,rmvb,mov"); |
| | | |
| | | assertTrue(FileController.isAllowedExt("png", allowed)); |
| | | assertTrue(FileController.isAllowedExt("pdf", allowed)); |
| | | assertTrue(FileController.isAllowedExt("MP4", allowed)); |
| | | assertTrue(FileController.isAllowedExt(".mov", allowed)); |