This is an automated email from the ASF dual-hosted git repository. jleroux pushed a commit to branch release22.01 in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git
commit cd4456cf12addfd939322a31437a0069871dc13c Author: Jacques Le Roux <jacques.le.r...@les7arts.com> AuthorDate: Fri Sep 30 13:38:33 2022 +0200 Fixed: Unable to upload a CSV file (OFBIZ-12636) While testing on "Upgrade pdfbox to 2.0.27 (OFBIZ-12698)" I found that I could not upload a valid PDF. Actually it was due to SecuredUpload::isValidCsvFile that was crashing when uploading this PDF file. I don't remember clearly but it was for a reason that I did not put the call to isValidCsvFile as the last check in isValidFile for the "all" and default case. As I can't remember now and it works for both CSV and PDF as "all" (when adding files from an user profile) I eventually decided to put "isValidCsvFile" at the end of the check. Unfortunately, it's complicate to test all possible combinations. --- .../src/main/java/org/apache/ofbiz/security/SecuredUpload.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/framework/security/src/main/java/org/apache/ofbiz/security/SecuredUpload.java b/framework/security/src/main/java/org/apache/ofbiz/security/SecuredUpload.java index 52fd639818..d71c848d63 100644 --- a/framework/security/src/main/java/org/apache/ofbiz/security/SecuredUpload.java +++ b/framework/security/src/main/java/org/apache/ofbiz/security/SecuredUpload.java @@ -277,8 +277,8 @@ public class SecuredUpload { || isValidCompressedFile(fileToCheck, delegator) || isValidAudioFile(fileToCheck) || isValidVideoFile(fileToCheck) - || isValidCsvFile(fileToCheck) - || isValidPdfFile(fileToCheck)) { + || isValidPdfFile(fileToCheck) + || isValidCsvFile(fileToCheck)) { return true; } break;