This is an automated email from the ASF dual-hosted git repository. jleroux pushed a commit to branch trunk in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git
commit 1e1f635b81a7928f5c00b9e1874eda8bc6ab3d9d Author: Jacques Le Roux <[email protected]> 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 0037f607fa..f0c9875641 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 @@ -275,8 +275,8 @@ public class SecuredUpload { || isValidCompressedFile(fileToCheck, delegator) || isValidAudioFile(fileToCheck) || isValidVideoFile(fileToCheck) - || isValidCsvFile(fileToCheck) - || isValidPdfFile(fileToCheck)) { + || isValidPdfFile(fileToCheck) + || isValidCsvFile(fileToCheck)) { return true; } break;

