diff --git a/webgoat-container/src/main/java/org/owasp/webgoat/util/HtmlEncoder.java b/webgoat-container/src/main/java/org/owasp/webgoat/util/HtmlEncoder.java index 31a56a6293..3b7dfa62d0 100644 --- a/webgoat-container/src/main/java/org/owasp/webgoat/util/HtmlEncoder.java +++ b/webgoat-container/src/main/java/org/owasp/webgoat/util/HtmlEncoder.java @@ -119,14 +119,13 @@ public class HtmlEncoder }; /** - *
Constructor for HtmlEncoder.
+ * Initialises the mappings between entities and characters */ - public HtmlEncoder() - { - for (int i = 0; i < entities.length; i++) - e2i.put((String) entities[i][0], (Integer) entities[i][1]); - for (int i = 0; i < entities.length; i++) - i2e.put((Integer) entities[i][1], (String) entities[i][0]); + static { + for (int i = 0; i < entities.length; i++) + e2i.put((String) entities[i][0], (Integer) entities[i][1]); + for (int i = 0; i < entities.length; i++) + i2e.put((Integer) entities[i][1], (String) entities[i][0]); } /**