Skip to content
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

Straight shoota sanitizer #264

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Conversation

jaimeiniesta
Copy link
Owner

This PR takes the work by @straight-shoota in #193 so it's easier to fix conflicts.

straight-shoota and others added 6 commits October 19, 2016 17:58
Raw HTML is provided by `*_raw` methods. Prefix-free reader methods automatically provide sanitized strings.
`MetaInspector::Sanitizer` completely removes possibly dangerous tags such as `<script>` and unknown tags
including der content. Safe tags are replaced by their text content. HTML entities are decoded and additional
whitespace removed, just as a browser would do (explicit whitespace like in `<pre>` tags are not preserved).
This changes behaviour such that the suffix-free methods now provide a properly sanitized strings without unnecessary
whitespaces.

For sanitizing the gems 'loofah' and 'htmlentities' are added as dependencies.
…de` method and `sanitized_attributes` creates readers

`att` and `att_raw`. The latter calls `inner_html` on the return value from node method. Now scrubbing in the sanitizer
can use the already existing HTML objects instead of serializing and parsing again.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants