mirror of
https://github.com/Frooodle/Stirling-PDF.git
synced 2025-08-11 13:48:37 +02:00
📁 pre-commit
Signed-off-by: stirlingbot[bot] <stirlingbot[bot]@users.noreply.github.com>
This commit is contained in:
parent
ae8f68427b
commit
c04a4bbd11
@ -72,10 +72,13 @@ public class StampController {
|
|||||||
MultipartFile stampImage = request.getStampImage();
|
MultipartFile stampImage = request.getStampImage();
|
||||||
if ("image".equalsIgnoreCase(stampType)) {
|
if ("image".equalsIgnoreCase(stampType)) {
|
||||||
if (stampImage == null) {
|
if (stampImage == null) {
|
||||||
throw new IllegalArgumentException("Stamp image file must be provided when stamp type is 'image'");
|
throw new IllegalArgumentException(
|
||||||
|
"Stamp image file must be provided when stamp type is 'image'");
|
||||||
}
|
}
|
||||||
String stampImageName = stampImage.getOriginalFilename();
|
String stampImageName = stampImage.getOriginalFilename();
|
||||||
if (stampImageName == null || stampImageName.contains("..") || stampImageName.startsWith("/")) {
|
if (stampImageName == null
|
||||||
|
|| stampImageName.contains("..")
|
||||||
|
|| stampImageName.startsWith("/")) {
|
||||||
throw new IllegalArgumentException("Invalid stamp image file path");
|
throw new IllegalArgumentException("Invalid stamp image file path");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user