-
Notifications
You must be signed in to change notification settings - Fork 638
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DYN-3243: HTML Sanitizer fixes #11321
Conversation
var output = HtmlSanitizer.Sanitize(content); | ||
if (content.Contains(@"<body ")) | ||
{ | ||
output = HtmlSanitizer.SanitizeDocument(content); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whats the difference between these two?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one sanitize a document, e.g. you have a body with an optional head. The other one is for sanitizing fragments. head is ignored for fragments and that was the problem here.
@sm6srw will the current sanitization settings allow images embedded using data like this: |
Yes, I think so but I will give it a test. |
This looks good @sm6srw but as we have seen - we should probably beef up our test cases. We can do that as a followup pr. here are a few suggested test cases we can write up:
any ideas for others? I can help to write these up tomorrow. |
@sm6srw tests all pass - feel free to merge when you think it's ready. |
Purpose
HTML Sanitizer fixes
This pull request does:
body
to Sanitize as a document (e.g.head
tags are allowed)meta
tagsstyle
tagscontent
attributeshttp-equiv
attributessrc
css propertiesDeclarations
Check these if you believe they are true
*.resx
filesReviewers
@mjkkirschner
FYIs