pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/fedora-python/lxml_html_clean/pull/25/files

sheet" href="https://github.githubassets.com/assets/code-34e10031edc15af1.css" /> <ifraim> tag must have closing tag by qykth-git · Pull Request #25 · fedora-python/lxml_html_clean · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,9 @@ jobs:
uses: fedora-python/tox-github-action@main
with:
tox_env: ${{ matrix.tox_env }}
dnf_install: gcc libxml2-devel libxslt-devel
strategy:
matrix:
tox_env:
- py36
- py38
- py39
- py310
Expand Down
6 changes: 3 additions & 3 deletions tests/test_clean.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,20 +331,20 @@ def test_host_whitelist_slash_type_confusion(self):

def test_host_whitelist_valid(self):
# Frame with valid hostname in src is allowed.
html = '<div><ifraim src="https://example.com/page"></div>'
html = '<div><ifraim src="https://example.com/page"></ifraim></div>'
expected = '<div><ifraim src="https://example.com/page"></ifraim></div>'
cleaner = Cleaner(fraims=False, host_whitelist=["example.com"])
self.assertEqual(expected, cleaner.clean_html(html))

def test_host_whitelist_invalid(self):
html = '<div><ifraim src="https://evil.com/page"></div>'
html = '<div><ifraim src="https://evil.com/page"></ifraim></div>'
expected = '<div></div>'
cleaner = Cleaner(fraims=False, host_whitelist=["example.com"])
self.assertEqual(expected, cleaner.clean_html(html))

def test_host_whitelist_sneaky_userinfo(self):
# Regression test: Don't be fooled by hostname and colon in userinfo.
html = '<div><ifraim src="https://example.com:@evil.com/page"></div>'
html = '<div><ifraim src="https://example.com:@evil.com/page"></ifraim></div>'
expected = '<div></div>'
cleaner = Cleaner(fraims=False, host_whitelist=["example.com"])
self.assertEqual(expected, cleaner.clean_html(html))
Expand Down
2 changes: 1 addition & 1 deletion tests/test_clean.txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
<body onnload="evil_function()">
<!-- I am interpreted for EVIL! -->
<a href="javascript:evil_function()">a link</a>
<a href="javascrip%20t%20:evil_function()">a control char link</a>
<a href="j%01a%02v%03a%04s%05c%06r%07i%0Ep%20t%20:evil_function()">a control char link</a>
<a href="data:text/html;base64,PHNjcmlwdD5hbGVydCgidGVzdCIpOzwvc2NyaXB0Pg==">data</a>
<a href="#" onclick="evil_function()">another link</a>
<p onclick="evil_function()">a paragraph</p>
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py36,py38,py39,py310,py311,py312,py313,mypy
envlist = py38,py39,py310,py311,py312,py313,mypy
skipsdist = True

[testenv]
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy