Skip to content

decode method doesn't work proper for some strings #814

Open
@mukesh4804

Description

@mukesh4804

Describe the bug
decode method doesn't work proper for some strings

Specify what ESAPI version(s) you are experiencing this bug in
2.5.2

To Reproduce
https://github.com/ESAPI/esapi-java-legacy
I am using the test folder of above git repository .

public class HTMLEntityCodecTest {
Codec codec = new HTMLEntityCodec();

@Test
public void testEntityDecoding(){
    assertEquals("#", codec.decode("#"));
    
}

}

Expected behavior
true

decode method should return # instead of νm .

Here '&num' encoded should be returning '#', but instead its returning 'vm' that is 'v' for '&nu' and 'm' for 'm'

https://dev.w3.org/html5/html-author/charref

Screenshots
If applicable, add screenshots to help explain your problem.
[NOTE: Please do NOT just ask general questions here as they will not be answered. Instead, please use the GitHub Discussions and create a new topic under 'Questions and Answers".
Please delete any irrelevant portion of this template before submitting your GitHub issue. Thanks.]

Platform environment (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • JDK version used with ESAPI

Additional context
Add any other context about the problem here.
If known, please select the label corresponding to the affected ESAPI component.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions