From c86e7631b30f8202fc370e692122a1d3e3ba527b Mon Sep 17 00:00:00 2001 From: e551763 Date: Tue, 2 Jul 2024 16:12:15 +0200 Subject: [PATCH] chore: polynomial regular expression fix attempt #3 --- .../sbb/polarion/extension/pdf/exporter/util/HtmlProcessor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/ch/sbb/polarion/extension/pdf/exporter/util/HtmlProcessor.java b/src/main/java/ch/sbb/polarion/extension/pdf/exporter/util/HtmlProcessor.java index 6ee9f5e..894eeeb 100644 --- a/src/main/java/ch/sbb/polarion/extension/pdf/exporter/util/HtmlProcessor.java +++ b/src/main/java/ch/sbb/polarion/extension/pdf/exporter/util/HtmlProcessor.java @@ -1107,7 +1107,7 @@ private int findTableEnd(String html, int tableStart) { @SuppressWarnings({"java:S5852", "java:S5857"}) //need by design public String replaceImagesAsBase64Encoded(String html) { // Replace encoded underscore symbol in 'src' attribute of images - Matcher encodedUnderscoreMatcher = Pattern.compile("src=\"[^\"]*%5F[^\"]*\"").matcher(html); + Matcher encodedUnderscoreMatcher = Pattern.compile("src=\"[^\"]*(?:%5F)+[^\"]*\"").matcher(html); StringBuilder buf = new StringBuilder(); while (encodedUnderscoreMatcher.find()) { String group = encodedUnderscoreMatcher.group();