mirror of
https://github.com/Qortal/qortal.git
synced 2025-05-05 17:27:52 +00:00
Allow files without extensions in QCHAT_ATTACHMENT validation.
This commit is contained in:
parent
9f30571b12
commit
6196841609
@ -42,7 +42,8 @@ public enum Service {
|
|||||||
return ValidationResult.DIRECTORIES_NOT_ALLOWED;
|
return ValidationResult.DIRECTORIES_NOT_ALLOWED;
|
||||||
}
|
}
|
||||||
final String extension = FilenameUtils.getExtension(file.getName()).toLowerCase();
|
final String extension = FilenameUtils.getExtension(file.getName()).toLowerCase();
|
||||||
final List<String> allowedExtensions = Arrays.asList("zip", "pdf", "txt", "odt", "ods", "doc", "docx", "xls", "xlsx", "ppt", "pptx");
|
// We must allow blank file extensions because these are used by data published from a plaintext or base64-encoded string
|
||||||
|
final List<String> allowedExtensions = Arrays.asList("zip", "pdf", "txt", "odt", "ods", "doc", "docx", "xls", "xlsx", "ppt", "pptx", "");
|
||||||
if (extension == null || !allowedExtensions.contains(extension)) {
|
if (extension == null || !allowedExtensions.contains(extension)) {
|
||||||
return ValidationResult.INVALID_FILE_EXTENSION;
|
return ValidationResult.INVALID_FILE_EXTENSION;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user