Skip to content

Commit

Permalink
Issue checkstyle#141: Some config results in OOM, reduce list of proj…
Browse files Browse the repository at this point in the history
…ect in config
  • Loading branch information
piyush kumar sadangi authored and piyush kumar sadangi committed Oct 13, 2024
1 parent bfb64f3 commit 57aefd1
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,9 @@ private static void appendProperty(final StringBuilder builder, final String ind
private static String escapeXml(final String input) {
String result = input;
if (input != null && !input.isEmpty()) {
result = input.replace("\"", """)
result = input.replace("&", "&")
.replace("<", "&lt;")
.replace("\"", "&quot;")
.replace("'", "&apos;");
}
return result;
Expand All @@ -535,6 +537,10 @@ private static String escapeXml(final String input) {
private static String escapeXmlAttributeValue(final String input, final char delimiter) {
String result = input;
if (input != null && !input.isEmpty()) {
// Escape '&', '<', and '>'
result = result.replace("&", "&amp;")
.replace("<", "&lt;");
// Escape the delimiter character
if (delimiter == '\'') {
result = result.replace("'", "&apos;");
}
Expand Down

0 comments on commit 57aefd1

Please sign in to comment.