diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2025-03-27 10:13:50 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2025-10-15 19:32:59 +0200 |
commit | cce78c74ee4bd53ed46f9e7798bd07b250835a68 (patch) | |
tree | c3ccbb181495b59dfedd5f7950295b144f91beed /ishtar_common | |
parent | 089e88dafa924ba4e105d2955ea152e48ac0c43f (diff) | |
download | Ishtar-cce78c74ee4bd53ed46f9e7798bd07b250835a68.tar.bz2 Ishtar-cce78c74ee4bd53ed46f9e7798bd07b250835a68.zip |
♻️ use specific library to sanitize files path
Diffstat (limited to 'ishtar_common')
-rw-r--r-- | ishtar_common/libreoffice.py | 3 | ||||
-rw-r--r-- | ishtar_common/utils.py | 8 |
2 files changed, 2 insertions, 9 deletions
diff --git a/ishtar_common/libreoffice.py b/ishtar_common/libreoffice.py index 573d99361..7ef33efba 100644 --- a/ishtar_common/libreoffice.py +++ b/ishtar_common/libreoffice.py @@ -1,5 +1,6 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- +from pathvalidate import sanitize_filepath import time import uno @@ -13,7 +14,7 @@ import subprocess # nosec #from com.sun.star.table import CellRangeAddress, CellAddress -from ishtar_common.utils import num2col, sanitize_filepath +from ishtar_common.utils import num2col from django.conf import settings diff --git a/ishtar_common/utils.py b/ishtar_common/utils.py index 52bcd3ddb..8d5f5ec20 100644 --- a/ishtar_common/utils.py +++ b/ishtar_common/utils.py @@ -1828,14 +1828,6 @@ def clean_session_cache(session): cache.set(cache_key_list, [], settings.CACHE_TIMEOUT) -def sanitize_filepath(filepath): - #TODO: python3-pathvalidate - # from pathvalidate import sanitize_filepath - # filepath -> sanitize_filepath(filepath) - keep_characters = (" ", ".", "_", "-", "/") - return "".join(c for c in filepath if c.isalnum() or c in keep_characters).rstrip() - - def get_field_labels_from_path(model, path): """ :param model: base model |