mirror of
https://github.com/inventree/InvenTree.git
synced 2026-11-24 16:57:30 +00:00
Small fixes (#13333)
* add missing catch * use replaceAll instead * add explicit expects to fix juint result reporting * fix path traversal * try make this more stable * use a loop to make this more stable against autoclosing menus * plugins are somewhat unpredictable so adding some slck
This commit is contained in:
1 parent
7933454b89
commit
6c5cb2910a
9 files changed
+70
-33
No files matched your search
@@ -145,7 +145,13 @@ def _copy_plugin_static_files(slug: str):
|
||||
continue
|
||||
|
||||
relative_path = item.relative_to(source_path).as_posix()
|
||||
target = staging_path / relative_path
|
||||
target = staging_path.joinpath(relative_path)
|
||||
try:
|
||||
target.relative_to(staging_path, walk_up=False)
|
||||
except ValueError:
|
||||
raise ValueError(
|
||||
f"Target path '{target}' is not within staging path '{staging_path}'"
|
||||
)
|
||||
target.parent.mkdir(parents=True, exist_ok=True)
|
||||
target.write_bytes(item.read_bytes())
|
||||
|
||||
|
||||
Reference in new issue
Block a user