mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-10-31 03:55:43 +00:00
Chore: Import lxml lazily in the SVG validator
This commit is contained in:
1 parent
bc051a4ce3
commit
06cd62170d
1 file changed
+1
-1
@@ -3,7 +3,6 @@ from io import BytesIO
|
||||
from django.conf import settings
|
||||
from django.core.exceptions import ValidationError
|
||||
from django.core.files.uploadedfile import UploadedFile
|
||||
from lxml import etree
|
||||
from PIL import Image
|
||||
|
||||
ALLOWED_SVG_TAGS: set[str] = {
|
||||
@@ -186,6 +185,7 @@ def reject_dangerous_svg(file: UploadedFile) -> None:
|
||||
Raises ValidationError if unsafe content is found.
|
||||
See GHSA-6p53-hqqw-8j62
|
||||
"""
|
||||
from lxml import etree
|
||||
|
||||
try:
|
||||
parser = etree.XMLParser(resolve_entities=False)
|
||||
|
||||
Reference in new issue
Block a user