forked from MarseyWorld/MarseyWorld
fix RCE, thank you @Camas
parent
4bae98dab0
commit
30ed6daa26
|
@ -10,7 +10,7 @@ from .const import *
|
|||
|
||||
|
||||
def process_audio(file):
|
||||
name = f'/audio/{time.time()}'.replace('.','') + '.' + file.filename.split('.')[-1].lower()
|
||||
name = f'/audio/{time.time()}'.replace('.','') + '.mp3'
|
||||
file.save(name)
|
||||
|
||||
if os.stat(name).st_size > 8 * 1024 * 1024:
|
||||
|
@ -24,8 +24,7 @@ def process_audio(file):
|
|||
|
||||
def process_video(file):
|
||||
old = f'/videos/{time.time()}'.replace('.','')
|
||||
extension = file.filename.split('.')[-1].lower()
|
||||
new = old + '.' + extension
|
||||
new = old + '.mp4'
|
||||
|
||||
if extension == 'webm':
|
||||
file.save(new)
|
||||
|
@ -71,4 +70,4 @@ def process_image(patron, filename=None, resize=0):
|
|||
i = ImageOps.exif_transpose(i)
|
||||
i.save(filename, format="WEBP", method=6)
|
||||
|
||||
return filename
|
||||
return filename
|
||||
|
|
Loading…
Reference in New Issue