diff options
Diffstat (limited to 'meta-python/recipes-devtools/python/python3-django/Fix-undefined-_lazy_re_compile.patch')
| -rw-r--r-- | meta-python/recipes-devtools/python/python3-django/Fix-undefined-_lazy_re_compile.patch | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/meta-python/recipes-devtools/python/python3-django/Fix-undefined-_lazy_re_compile.patch b/meta-python/recipes-devtools/python/python3-django/Fix-undefined-_lazy_re_compile.patch new file mode 100644 index 0000000000..226aaea07a --- /dev/null +++ b/meta-python/recipes-devtools/python/python3-django/Fix-undefined-_lazy_re_compile.patch | |||
| @@ -0,0 +1,49 @@ | |||
| 1 | From f89fec5d58bc1684478fe23c29a34f17ca529b1a Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Haixiao Yan <haixiao.yan.cn@windriver.com> | ||
| 3 | Date: Tue, 13 Jan 2026 14:14:02 +0800 | ||
| 4 | Subject: [PATCH] python3-django: Fix undefined _lazy_re_compile | ||
| 5 | |||
| 6 | Fix the following error introduced by CVE-2024-27351.patch and | ||
| 7 | CVE-2025-32873.patch: | ||
| 8 | |||
| 9 | NameError: name '_lazy_re_compile' is not defined | ||
| 10 | |||
| 11 | Upstream-Status: Inappropriate [Fix the regression in the previous fix for CVE-2024-27351 and CVE-2025-32873] | ||
| 12 | |||
| 13 | Signed-off-by: Haixiao Yan <haixiao.yan.cn@windriver.com> | ||
| 14 | --- | ||
| 15 | django/utils/html.py | 2 +- | ||
| 16 | django/utils/text.py | 4 ++-- | ||
| 17 | 2 files changed, 3 insertions(+), 3 deletions(-) | ||
| 18 | |||
| 19 | diff --git a/django/utils/html.py b/django/utils/html.py | ||
| 20 | index 858a517d92f8..6eb8bc3dbf38 100644 | ||
| 21 | --- a/django/utils/html.py | ||
| 22 | +++ b/django/utils/html.py | ||
| 23 | @@ -38,7 +38,7 @@ _html_escapes = { | ||
| 24 | } | ||
| 25 | |||
| 26 | # HTML tag that opens but has no closing ">" after 1k+ chars. | ||
| 27 | -long_open_tag_without_closing_re = _lazy_re_compile(r"<[a-zA-Z][^>]{1000,}") | ||
| 28 | +long_open_tag_without_closing_re = re.compile(r"<[a-zA-Z][^>]{1000,}") | ||
| 29 | |||
| 30 | |||
| 31 | @keep_lazy(str, SafeText) | ||
| 32 | diff --git a/django/utils/text.py b/django/utils/text.py | ||
| 33 | index c474d5681eeb..e104b60c4f6c 100644 | ||
| 34 | --- a/django/utils/text.py | ||
| 35 | +++ b/django/utils/text.py | ||
| 36 | @@ -27,8 +27,8 @@ def capfirst(x): | ||
| 37 | # text with only open brackets "<<<...". The class below provides the services | ||
| 38 | # and correct answers for the use cases, but in these edge cases does it much | ||
| 39 | # faster. | ||
| 40 | -re_notag = _lazy_re_compile(r"([^<>\s]+)", re.S) | ||
| 41 | -re_prt = _lazy_re_compile(r"<|([^<>\s]+)", re.S) | ||
| 42 | +re_notag = re.compile(r"([^<>\s]+)", re.S) | ||
| 43 | +re_prt = re.compile(r"<|([^<>\s]+)", re.S) | ||
| 44 | |||
| 45 | |||
| 46 | class WordsRegex: | ||
| 47 | -- | ||
| 48 | 2.34.1 | ||
| 49 | |||
