2605210ed4
* Add missing comma to tinycss2 require. Thank you, @shadchin! * Add url parse tests based on wpt url tests. (#688) * Support scheme-less urls if "https" is in allow list. (#662) * Handle escaping ``<`` in edge cases where it doesn't start a tag. (#544) * Correctly urlencode email address parts. Thank you, @larseggert! (#659) * ``clean`` and ``linkify`` now preserve the order of HTML attributes. * Drop support for Python 3.6. Thank you, @hugovk! (#629) * CSS sanitization in style tags is completely different now. * Python 3.9 support * Drop support for unsupported Python versions <3.6. (#520) * add more tests for CVE-2021-23980 / GHSA-vv2x-vrpj-qqpq - Refresh de-vendor.patch, and convert to patch level 1 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-bleach?expand=0&rev=43
89 lines
3.1 KiB
Diff
89 lines
3.1 KiB
Diff
--- a/bleach/html5lib_shim.py.orig
|
|
+++ b/bleach/html5lib_shim.py
|
|
@@ -14,46 +14,46 @@ warnings.filterwarnings(
|
|
"ignore",
|
|
message="html5lib's sanitizer is deprecated",
|
|
category=DeprecationWarning,
|
|
- module="bleach._vendor.html5lib",
|
|
+ module="html5lib",
|
|
)
|
|
|
|
-from bleach._vendor.html5lib import ( # noqa: E402 module level import not at top of file
|
|
+from html5lib import ( # noqa: E402 module level import not at top of file
|
|
HTMLParser,
|
|
getTreeWalker,
|
|
)
|
|
-from bleach._vendor.html5lib import (
|
|
+from html5lib import (
|
|
constants,
|
|
) # noqa: E402 module level import not at top of file
|
|
-from bleach._vendor.html5lib.constants import ( # noqa: E402 module level import not at top of file
|
|
+from html5lib.constants import ( # noqa: E402 module level import not at top of file
|
|
namespaces,
|
|
prefixes,
|
|
)
|
|
-from bleach._vendor.html5lib.constants import (
|
|
+from html5lib.constants import (
|
|
_ReparseException as ReparseException,
|
|
) # noqa: E402 module level import not at top of file
|
|
-from bleach._vendor.html5lib.filters.base import (
|
|
+from html5lib.filters.base import (
|
|
Filter,
|
|
) # noqa: E402 module level import not at top of file
|
|
-from bleach._vendor.html5lib.filters.sanitizer import (
|
|
+from html5lib.filters.sanitizer import (
|
|
allowed_protocols,
|
|
allowed_css_properties,
|
|
allowed_svg_properties,
|
|
) # noqa: E402 module level import not at top of file
|
|
-from bleach._vendor.html5lib.filters.sanitizer import (
|
|
+from html5lib.filters.sanitizer import (
|
|
Filter as SanitizerFilter,
|
|
) # noqa: E402 module level import not at top of file
|
|
-from bleach._vendor.html5lib._inputstream import (
|
|
+from html5lib._inputstream import (
|
|
HTMLInputStream,
|
|
) # noqa: E402 module level import not at top of file
|
|
-from bleach._vendor.html5lib.serializer import (
|
|
+from html5lib.serializer import (
|
|
escape,
|
|
HTMLSerializer,
|
|
) # noqa: E402 module level import not at top of file
|
|
-from bleach._vendor.html5lib._tokenizer import (
|
|
+from html5lib._tokenizer import (
|
|
attributeMap,
|
|
HTMLTokenizer,
|
|
) # noqa: E402 module level import not at top of file
|
|
-from bleach._vendor.html5lib._trie import (
|
|
+from html5lib._trie import (
|
|
Trie,
|
|
) # noqa: E402 module level import not at top of file
|
|
|
|
--- a/tests/test_clean.py.orig
|
|
+++ b/tests/test_clean.py
|
|
@@ -5,7 +5,7 @@ import pytest
|
|
from bleach import clean
|
|
from bleach.html5lib_shim import Filter
|
|
from bleach.sanitizer import ALLOWED_PROTOCOLS, Cleaner
|
|
-from bleach._vendor.html5lib.constants import rcdataElements
|
|
+from html5lib.constants import rcdataElements
|
|
|
|
|
|
@pytest.mark.parametrize(
|
|
--- a/bleach/sanitizer.py.orig
|
|
+++ b/bleach/sanitizer.py
|
|
@@ -277,7 +277,7 @@ class BleachSanitizerFilter(html5lib_shi
|
|
"ignore",
|
|
message="html5lib's sanitizer is deprecated",
|
|
category=DeprecationWarning,
|
|
- module="bleach._vendor.html5lib",
|
|
+ module="html5lib",
|
|
)
|
|
return super().__init__(
|
|
source,
|
|
--- a/bleach/parse_shim.py.orig
|
|
+++ b/bleach/parse_shim.py
|
|
@@ -1 +1 @@
|
|
-from bleach._vendor.parse import urlparse # noqa
|
|
+from urllib.parse import urlparse # noqa
|