12
0

Compare commits

28 Commits

Author SHA256 Message Date
b0c7ac8fca Accepting request 1302922 from devel:languages:python
- python-pyhanko-cert-validator is included in python-pyHanko now

OBS-URL: https://build.opensuse.org/request/show/1302922
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-xhtml2pdf?expand=0&rev=11
2025-09-05 19:44:20 +00:00
838885d736 sorry
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-xhtml2pdf?expand=0&rev=30
2025-09-05 11:33:48 +00:00
5ccc462890 - python-pyhanko-cert-validator is included in python-pyHanko now
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-xhtml2pdf?expand=0&rev=29
2025-09-05 11:31:41 +00:00
dca9e648b0 Accepting request 1251964 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/1251964
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-xhtml2pdf?expand=0&rev=10
2025-03-11 19:44:46 +00:00
1093df3297 Accepting request 1231899 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/1231899
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-xhtml2pdf?expand=0&rev=9
2024-12-18 19:10:50 +00:00
949ad2e45f - Add CVE-2024-25885.patch (bsc#1231408, CVE-2024-25885)
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-xhtml2pdf?expand=0&rev=25
2024-12-18 13:43:21 +00:00
66fe46cb27 Accepting request 1201491 from devel:languages:python
- Update to 0.2.16:
  * New
    + OL tag allow start counter
    + Div, P, And Body allows dir attribute (rtl and ltr) to provide text
      direction
    + Add encryption and password protection
    + New WaterMark management system with new options
    + Add Graphic builder
    + Add signing pdfs (simple and pades)
  * Improvements
    + Page counter and Page number are now available as simple text inside
      paragraphs
    + New regex for strip up to curly bracket
    + Change pyPDF3 to pypdf.
  * Bug-Fixes
    + Add compatibility for reportlab >= 4.1
    + Make pyCairo dependency optional
    + Fix image rendering with link_callback
    + Fix TypeError on column widths specified as percentages
    + Fix TypeError when formatting width in debug logging
    + Fix page number & page count
    + Fix ZeroDivisionError on broken image files
    + Fix CSSParseError for minified @font-face definitions
    + Remove import cycle between utils and default
    + Fixed link_callback construction of path
    + Fixed path when is relative to current path
- Switch to autosetup and pyproject macros.
- No more greedy globs in %files.

OBS-URL: https://build.opensuse.org/request/show/1201491
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-xhtml2pdf?expand=0&rev=8
2024-09-17 16:18:24 +00:00
b344a850ee - Update to 0.2.16:
* New
    + OL tag allow start counter
    + Div, P, And Body allows dir attribute (rtl and ltr) to provide text
      direction
    + Add encryption and password protection
    + New WaterMark management system with new options
    + Add Graphic builder
    + Add signing pdfs (simple and pades)
  * Improvements
    + Page counter and Page number are now available as simple text inside
      paragraphs
    + New regex for strip up to curly bracket
    + Change pyPDF3 to pypdf.
  * Bug-Fixes
    + Add compatibility for reportlab >= 4.1
    + Make pyCairo dependency optional
    + Fix image rendering with link_callback
    + Fix TypeError on column widths specified as percentages
    + Fix TypeError when formatting width in debug logging
    + Fix page number & page count
    + Fix ZeroDivisionError on broken image files
    + Fix CSSParseError for minified @font-face definitions
    + Remove import cycle between utils and default
    + Fixed link_callback construction of path
    + Fixed path when is relative to current path
- Switch to autosetup and pyproject macros.
- No more greedy globs in %files.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-xhtml2pdf?expand=0&rev=23
2024-09-17 02:43:24 +00:00
527b3777e9 Accepting request 1011215 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/1011215
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-xhtml2pdf?expand=0&rev=7
2022-10-16 14:09:56 +00:00
ac0a0301eb Accepting request 1010934 from home:pgajdos:python
- version update to 0.2.6
  * Drop python 2 support.
  * Remove most of python 2 code and cleanup
  * Update packages dependencies
  * Remove six dependency and update Readme
  * Set timeout in https options
  * Add new file manager approach using factory method, now new classes deal with different types of data
  * B64InlineURI, LocalProtocolURI, NetworkFileUri, LocalFileURI, BytesFileUri
  * Now getColor return None when None is passed ignoring default value, but return default if bool(data) == false
  * rtl languages reversed lines added as a ParaFrag (note: not fully supported yet)
  * Check if Paragraph has 'rtl' attribute (note: not fully supported yet)
  * Fix UnboundLocalError in reportlab_paragraph (#585) (#586)
  * Remove usage of getStringIO (#590) removed form reportlab
  * Change test for github workflow using only Linux
  * Add Python 3.9, 3.10
  * Switch from PyPDF2 to PyPDF3
  * Add SVG support
  * Update package information.
  * Allow call tests using make.
- deleted patches
  - 590-rm-getStringIO.patch (upstreamed)

OBS-URL: https://build.opensuse.org/request/show/1010934
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-xhtml2pdf?expand=0&rev=21
2022-10-16 07:23:08 +00:00
ec725c6833 Accepting request 968017 from devel:languages:python
- Add 590-rm-getStringIO.patch, use standard StringIO
  (gh#xhtml2pdf/xhtml2pdf#589).

OBS-URL: https://build.opensuse.org/request/show/968017
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-xhtml2pdf?expand=0&rev=6
2022-04-09 22:42:12 +00:00
f6a27f43a3 - Add 590-rm-getStringIO.patch, use standard StringIO
(gh#xhtml2pdf/xhtml2pdf#589).

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-xhtml2pdf?expand=0&rev=19
2022-04-09 13:29:42 +00:00
Richard Brown
b87fcf42e1 Accepting request 870119 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/870119
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-xhtml2pdf?expand=0&rev=5
2021-03-30 19:01:28 +00:00
2e3c98497c Accepting request 870103 from home:jayvdb:branches:devel:languages:python
- Add missing runtime dependency on setuptools
- Remove hashbang from library modules
- Activate test suite
- Update to v0.2.5

OBS-URL: https://build.opensuse.org/request/show/870103
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-xhtml2pdf?expand=0&rev=17
2021-02-07 18:58:31 +00:00
5cb5ba9011 Accepting request 805893 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/805893
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-xhtml2pdf?expand=0&rev=4
2020-05-16 20:27:04 +00:00
Tomáš Chvátal
fb6e196689 Accepting request 805849 from home:pgajdos:python
submit

OBS-URL: https://build.opensuse.org/request/show/805849
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-xhtml2pdf?expand=0&rev=15
2020-05-15 17:38:45 +00:00
712403cbe5 Accepting request 770564 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/770564
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-xhtml2pdf?expand=0&rev=3
2020-02-07 14:53:38 +00:00
Tomáš Chvátal
a627ec0c95 Accepting request 770553 from home:mcalabkova:branches:devel:languages:python
- update to 0.2.4
  * add Python 3.8
  * Fixed padding problem
  * fix: use html.escape instead of cgi.escape
  * Removed `if cols_with_no_width` condition from `tables.py`.

OBS-URL: https://build.opensuse.org/request/show/770553
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-xhtml2pdf?expand=0&rev=13
2020-02-06 12:45:06 +00:00
16573ca095 Accepting request 682263 from devel:languages:python
- Update to 0.2.3:
  * various fixes/etc
  * no upstream changelog provided

OBS-URL: https://build.opensuse.org/request/show/682263
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-xhtml2pdf?expand=0&rev=2
2019-03-08 10:02:33 +00:00
Tomáš Chvátal
7ae802b1ba - Update to 0.2.3:
* various fixes/etc
  * no upstream changelog provided

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-xhtml2pdf?expand=0&rev=11
2019-03-06 18:39:03 +00:00
c01d1e453e Accepting request 557374 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/557374
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-xhtml2pdf?expand=0&rev=1
2018-01-13 20:44:23 +00:00
Tomáš Chvátal
65791c3183 - Switch to downloadable url
- Remove pointless patch

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-xhtml2pdf?expand=0&rev=7
2017-12-15 13:46:02 +00:00
Tomáš Chvátal
59cbd779dd - Cleanup a bit
- Update the requirements to match the upstream recommendations
- Run the tests
- Really enable the python3

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-xhtml2pdf?expand=0&rev=6
2017-12-15 13:33:00 +00:00
Tomáš Chvátal
368dbfd6e9 Accepting request 556998 from home:dstoecker
As required added python3 stuff. As python3 and python are conflicting and install tests fail for now python3 is disabled.

OBS-URL: https://build.opensuse.org/request/show/556998
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-xhtml2pdf?expand=0&rev=5
2017-12-15 12:22:39 +00:00
Denisart Benjamin
b25cbf802f Accepting request 418837 from home:dstoecker
Update to recent version to let it work again with the other python packages. 0.0.5 fails with reportlab >3.

OBS-URL: https://build.opensuse.org/request/show/418837
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-xhtml2pdf?expand=0&rev=4
2016-08-15 22:32:24 +00:00
Denisart Benjamin
4b00a687c2 Accepting request 207073 from home:posophe:branches:devel:languages:python
update

OBS-URL: https://build.opensuse.org/request/show/207073
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-xhtml2pdf?expand=0&rev=3
2013-11-15 19:56:42 +00:00
Sascha Peilicke
08e7f329dd - Require python-setuptools instead of distribute (upstreams merged)
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-xhtml2pdf?expand=0&rev=2
2013-10-24 11:17:38 +00:00
Sascha Peilicke
c330fdc0c6 Accepting request 145241 from home:jimfunk:python
OBS-URL: https://build.opensuse.org/request/show/145241
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-xhtml2pdf?expand=0&rev=1
2012-12-13 10:44:24 +00:00
5 changed files with 8 additions and 60 deletions

View File

@@ -1,49 +0,0 @@
From de0fdbdf4224f3277419c2080ca0fd35fd5948a5 Mon Sep 17 00:00:00 2001
From: David Trupiano <davetrupiano@gmail.com>
Date: Tue, 22 Oct 2024 15:45:54 -0400
Subject: [PATCH] fix reDOS CVE in getColor function
---
xhtml2pdf/util.py | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
diff --git a/xhtml2pdf/util.py b/xhtml2pdf/util.py
index ff4ac2a9..dafc1933 100644
--- a/xhtml2pdf/util.py
+++ b/xhtml2pdf/util.py
@@ -130,22 +130,31 @@ def getColor(value, default=None):
"""
Convert to color value.
This returns a Color object instance from a text bit.
+ Mitigation for ReDoS attack applied by limiting input length and validating input.
"""
if value is None:
return None
if isinstance(value, Color):
return value
value = str(value).strip().lower()
+
+ # Limit the length of the value to prevent excessive input causing ReDoS
+ if len(value) > 100: # Set a reasonable length limit to avoid extreme inputs
+ return default
+
if value in {"transparent", "none"}:
return default
if value in COLOR_BY_NAME:
return COLOR_BY_NAME[value]
if value.startswith("#") and len(value) == 4:
value = "#" + value[1] + value[1] + value[2] + value[2] + value[3] + value[3]
- elif rgb_re.search(value):
- # e.g., value = "<css function: rgb(153, 51, 153)>", go figure:
- r, g, b = (int(x) for x in rgb_re.search(value).groups())
- value = f"#{r:02x}{g:02x}{b:02x}"
+ elif rgb_re.match(value):
+ # Use match instead of search to ensure proper regex usage and limit to valid patterns
+ try:
+ r, g, b = (int(x) for x in rgb_re.match(value).groups())
+ value = f"#{r:02x}{g:02x}{b:02x}"
+ except ValueError:
+ pass
else:
# Shrug
pass

View File

@@ -1,3 +1,8 @@
-------------------------------------------------------------------
Fri Sep 5 11:30:19 UTC 2025 - Markéta Machová <mmachova@suse.com>
- python-pyhanko-cert-validator is included in python-pyHanko now
-------------------------------------------------------------------
Mon Mar 10 15:21:26 UTC 2025 - John Paul Adrian Glaubitz <adrian.glaubitz@suse.com>

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-xhtml2pdf
#
# Copyright (c) 2025 SUSE LLC
# Copyright (c) 2025 SUSE LLC and contributors
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -32,8 +32,7 @@ BuildRequires: python-rpm-macros
Requires: python-Pillow >= 8.1.1
Requires: python-arabic-reshaper >= 3.0.0
Requires: python-html5lib >= 1.1
Requires: python-pyHanko >= 0.12.1
Requires: python-pyhanko-certvalidator >= 0.19.5
Requires: python-pyHanko >= 0.19.5
Requires: python-pypdf >= 3.1.0
Requires: python-python-bidi >= 0.5.0
Requires: python-reportlab >= 4.0.4
@@ -46,8 +45,7 @@ BuildArch: noarch
BuildRequires: %{python_module Pillow >= 8.1.1}
BuildRequires: %{python_module arabic-reshaper >= 3.0.0}
BuildRequires: %{python_module html5lib >= 1.1}
BuildRequires: %{python_module pyHanko >= 0.12.1}
BuildRequires: %{python_module pyhanko-certvalidator >= 0.19.5}
BuildRequires: %{python_module pyHanko >= 0.19.5}
BuildRequires: %{python_module pypdf >= 3.1.0}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module python-bidi >= 0.5.0}

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c031b662d3f999e18f384e8d606be84a8a1e516d8380a87b3bd9fd2446a1e754
size 6960611

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ce0e2b711f5200f46caf2a67008700fb1de0a761f2ae92d30b21e158de05912e
size 6683074