This commit is contained in:
Ludy 2025-08-02 10:53:34 +00:00 committed by GitHub
commit 010ef11ec9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -70,9 +70,11 @@ public class StampController {
String stampType = request.getStampType();
String stampText = request.getStampText();
MultipartFile stampImage = request.getStampImage();
String stampImageName = stampImage.getOriginalFilename();
if (stampImageName.contains("..") || stampImageName.startsWith("/")) {
throw new IllegalArgumentException("Invalid stamp image file path");
if ("image".equalsIgnoreCase(stampType)) {
String stampImageName = stampImage.getOriginalFilename();
if (stampImageName == null || stampImageName.contains("..") || stampImageName.startsWith("/")) {
throw new IllegalArgumentException("Invalid stamp image file path");
}
}
String alphabet = request.getAlphabet();
float fontSize = request.getFontSize();