Fix two bugs

- Fix a bug when downloading a beyond chart which has another audio file.

- Fix a safety problem when downloading.
This commit is contained in:
Lost-MSth
2022-02-14 16:35:36 +08:00
parent ceebba4664
commit 35b954e549
3 changed files with 33 additions and 9 deletions

View File

@@ -702,7 +702,7 @@ def download_song(user_id):
def download(file_path):
try:
t = request.args.get('t')
message = server.arcdownload.is_token_able_download(t)
message = server.arcdownload.is_token_able_download(t, file_path)
if message == 0:
path = os.path.join('./database/songs', file_path)
if os.path.isfile(path) and not('../' in path or '..\\' in path):