Skip to content

Commit

Permalink
Merge pull request WebGoat#197 from span/htmlencoder
Browse files Browse the repository at this point in the history
Fixes WebGoat#195 by adding static initialisation of the maps
  • Loading branch information
mayhew64 committed Feb 12, 2016
2 parents 727e4ff + 77c4a04 commit dbb7598
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,13 @@ public class HtmlEncoder
};

/**
* <p>Constructor for HtmlEncoder.</p>
* 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]);
}

/**
Expand Down

0 comments on commit dbb7598

Please sign in to comment.