Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Look up for any protocol in hyperlink in editojs sanitizer (#6462)

Iga Karbowiakec22d921e3a5
diff --git a/saleor/core/sanitizers/editorjs_sanitizer.py b/saleor/core/sanitizers/editorjs_sanitizer.py
index 4acfaa041b..a8deb0a8f9 100644
--- a/saleor/core/sanitizers/editorjs_sanitizer.py
+++ b/saleor/core/sanitizers/editorjs_sanitizer.py
@@ -4,9 +4,7 @@ import warnings
from urllib3.util import parse_url
BLACKLISTED_URL_SCHEMES = ("javascript",)
-HYPERLINK_TAG_WITH_URL_PATTERN = (
- r"(.*?<a\s+href=\\?\")((?:https://|http://)\S+[^\\])(\\?\">)"
-)
+HYPERLINK_TAG_WITH_URL_PATTERN = r"(.*?<a\s+href=\\?\")(\w+://\S+[^\\])(\\?\">)"
def clean_editor_js(definitions: dict):