Update StampController.java

This commit is contained in:
Ludy87 2025-08-02 12:32:23 +02:00
parent a5d219ed05
commit ceb3155ff7
No known key found for this signature in database
GPG Key ID: 92696155E0220F94

View File

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