From 3fde4b0164d1eb2f3fb32718b4011fff2b2b80ed Mon Sep 17 00:00:00 2001 From: Alexander Marsalek Date: Tue, 1 Jun 2021 11:19:25 +0200 Subject: filter everything from placeholder id except 0-9 during placeholder generation --- .../gv/egiz/pdfas/web/servlets/PlaceholderGeneratorServlet.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'pdf-as-web/src/main/java/at/gv/egiz/pdfas') diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/PlaceholderGeneratorServlet.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/PlaceholderGeneratorServlet.java index 5f2dc95c..6e80fad8 100644 --- a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/PlaceholderGeneratorServlet.java +++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/PlaceholderGeneratorServlet.java @@ -73,9 +73,11 @@ public class PlaceholderGeneratorServlet extends HttpServlet implements Placehol String filename = "placeholder"; if(id != null && !id.isEmpty()) { - id = id.replaceAll("[^a-zA-Z0-9]", "_"); - buildString = buildString + ";" + SignaturePlaceholderData.ID_KEY + "=" + id; - filename = filename + "_" + id; + id = id.replaceAll("[^0-9]", ""); + if(id != null && !id.isEmpty()) { + buildString = buildString + ";" + SignaturePlaceholderData.ID_KEY + "=" + id; + filename = filename + "_" + id; + } } if(profile != null && !profile.isEmpty()) { -- cgit v1.2.3