File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
src/opengeodeweb_back/routes Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -301,7 +301,9 @@ def export_project() -> flask.Response:
301301 for entry in session .query (Data ).all ()
302302 ]
303303
304- with zipfile .ZipFile (export_zip_path , "w" , compression = zipfile .ZIP_DEFLATED ) as zip_file :
304+ with zipfile .ZipFile (
305+ export_zip_path , "w" , compression = zipfile .ZIP_DEFLATED
306+ ) as zip_file :
305307 database_root_path = os .path .join (project_folder , "project.db" )
306308 if os .path .isfile (database_root_path ):
307309 zip_file .write (database_root_path , "project.db" )
@@ -352,8 +354,12 @@ def import_project() -> flask.Response:
352354 with zipfile .ZipFile (zip_file .stream ) as zip_archive :
353355 project_folder = os .path .abspath (data_folder_path )
354356 for member in zip_archive .namelist ():
355- target = os .path .abspath (os .path .normpath (os .path .join (project_folder , member )))
356- if not (target == project_folder or target .startswith (project_folder + os .sep )):
357+ target = os .path .abspath (
358+ os .path .normpath (os .path .join (project_folder , member ))
359+ )
360+ if not (
361+ target == project_folder or target .startswith (project_folder + os .sep )
362+ ):
357363 flask .abort (400 , "Zip contains unsafe paths" )
358364 zip_archive .extractall (project_folder )
359365
You can’t perform that action at this time.
0 commit comments