summaryrefslogtreecommitdiffstats
path: root/meta-python/recipes-devtools/python/python3-django
diff options
context:
space:
mode:
authorGyorgy Sarvari <skandigraun@gmail.com>2026-01-14 08:34:38 +0100
committerGyorgy Sarvari <skandigraun@gmail.com>2026-01-15 13:50:49 +0100
commit4638d0ee2288d74619060c057496b331ca0fdd85 (patch)
treefadc7c5a96c4c575c0dc783ff61dcaca2bb5af4f /meta-python/recipes-devtools/python/python3-django
parent75a627cd00ebb054093d541aede2f4deae20f10b (diff)
downloadmeta-openembedded-4638d0ee2288d74619060c057496b331ca0fdd85.tar.gz
python3-django: fix regression from CVE-2024-24680 patch
This change is for python3-django_2.2.28. The patch that mitigated CVE-2024-246680 accidentally also brought a regression, some numbers were converted to (human-friendly) string incorrectly. This backported patch mitigates this problem. Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
Diffstat (limited to 'meta-python/recipes-devtools/python/python3-django')
-rw-r--r--meta-python/recipes-devtools/python/python3-django/0001-Fixed-35172-Fixed-intcomma-for-string-floats.patch30
1 files changed, 30 insertions, 0 deletions
diff --git a/meta-python/recipes-devtools/python/python3-django/0001-Fixed-35172-Fixed-intcomma-for-string-floats.patch b/meta-python/recipes-devtools/python/python3-django/0001-Fixed-35172-Fixed-intcomma-for-string-floats.patch
new file mode 100644
index 0000000000..75b816ab55
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-django/0001-Fixed-35172-Fixed-intcomma-for-string-floats.patch
@@ -0,0 +1,30 @@
1From 820af24fcaae817ab7c0733035673afc3b37eeac Mon Sep 17 00:00:00 2001
2From: Gyorgy Sarvari <skandigraun@gmail.com>
3Date: Thu, 8 Feb 2024 10:58:54 +0100
4Subject: [PATCH] Fixed #35172 -- Fixed intcomma for string floats.
5
6From: Mariusz Felisiak <felisiak.mariusz@gmail.com>
7
8Thanks Warwick Brown for the report.
9
10Regression in 55519d6cf8998fe4c8f5c8abffc2b10a7c3d14e9.
11
12Upstream-Status: Backport [https://github.com/django/django/commit/2f14c2cedc9c92373471c1f98a80c81ba299584a]
13Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
14---
15 django/contrib/humanize/templatetags/humanize.py | 2 ++
16 1 file changed, 2 insertions(+)
17
18diff --git a/django/contrib/humanize/templatetags/humanize.py b/django/contrib/humanize/templatetags/humanize.py
19index ee22a45..8490b5e 100644
20--- a/django/contrib/humanize/templatetags/humanize.py
21+++ b/django/contrib/humanize/templatetags/humanize.py
22@@ -77,6 +77,8 @@ def intcomma(value, use_l10n=True):
23 if match:
24 prefix = match[0]
25 prefix_with_commas = re.sub(r"\d{3}", r"\g<0>,", prefix[::-1])[::-1]
26+ # Remove a leading comma, if needed.
27+ prefix_with_commas = re.sub(r"^(-?),", r"\1", prefix_with_commas)
28 result = prefix_with_commas + result[len(prefix) :]
29 return result
30