I'm new to the owasp sanitizer, and would like to know why some HTML entities are being unescaped and how to avoid it if possible?
For example, it seems no matter what policy I pass in to the sanitizer the following string gets converted from this:
@ test !
into this:
@ test !
The difference is that the "!" text has been converted into it's character "!". I don't see how to configure this on the sanitizer, and I want what my users input to be matched as much as possible when output by the sanitizer.
Thanks!
PS: Here's my sample code, which is a unit test to verify behavior I was expecting, and of course is failing right now.
package com.my.company.test;
import org.junit.Test;
import org.owasp.html.PolicyFactory;
import org.owasp.html.Sanitizers;
import junit.framework.TestCase;
public class OwaspSanitizerTest extends TestCase {
public static final PolicyFactory POLICY = Sanitizers.IMAGES;
@Test
public static final void testTextFilter() throws Exception {
String data = "@ test !";
String result = POLICY.sanitize(data);
System.out.println(result);
assertEquals("@ test !", result);
}
}
To unsubscribe from this group and stop receiving emails from it, send an email to owasp-java-html-saniti...@googlegroups.com.
>>>> > For more options, visit https://groups.google.com/d/optout.
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "OWASP Java HTML Sanitizer Support" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an