2012/7/25 <>:
> I just started using Java HTML sanitizer yesterday. But one issue is, I am
> not sure how to keep the '@' intact when a user types in their emails. I am
> creating my own policy file using HTMLPolicyBuilder. However, I am not sure
> how to keep their emails intact. I see only ways to allow attributes and
> elements. But this does not fall into any category.
I'm not sure I understand your question.
Given
<a href=mailto:happy_sanitizer@example.com>Send Me Email!!!</a>
the sanitizer produces
<a href="mailto:happy_sanitizer@example.com">Send Me Email!!!</a>
Is this what is causing you confusion? If so, when is this a problem?
In all browsers that I'm aware of, these are equivalent HTML as
demonstrated by this JavaScript
var div = document.createElement();
div.innerHTML = '<a href=mailto:happy_sanitizer@example.com>Send
2012/7/25 <elided>:
> I just started using Java HTML sanitizer yesterday. But one issue is, I am
> not sure how to keep the '@' intact when a user types in their emails. I am
> creating my own policy file using HTMLPolicyBuilder. However, I am not sure
> how to keep their emails intact. I see only ways to allow attributes and
> elements. But this does not fall into any category.
Thanks for the email Mike. Unfortunately, that is not my problem.I have a webpage used to add new users accepting their names and email addresses as input. We have a java class that receives all these paramaters, in this case, user_email="a...@aaa.com". This value is then sanitized via Java HTML sanitizer. I adopted the EBAYPolicy example to suit our needs. When the email value a...@aaa.com is sanitized, it sends it out as aaa&364aaa, which is further validated by our program. It needs to be in the format a...@aaa.com. Is there a way allow this in the sanitizer or do I need to handle it in a different way in our program so that @ is valid?
2012/7/26 AG <>:
Hello,
I just started using Java HTML sanitizer yesterday. But one issue is, I am not sure how to keep the '@' intact when a user types in their emails. I am creating my own policy file using HTMLPolicyBuilder. However, I am not sure how to keep their emails intact. I see only ways to allow attributes and elements. But this does not fall into any category.
Any pointers are appreciated.thanks,Asha