Skip to content

Commit

Permalink
bugfix: Check history dir path before refreshing
Browse files Browse the repository at this point in the history
  • Loading branch information
GaiZhenbiao committed Sep 18, 2024
1 parent fcdd5fd commit 71cb89c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions modules/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,9 @@ def get_history_names(user_name=""):
if user_name == "" and hide_history_when_not_logged_in:
return []
else:
user_history_dir = os.path.join(HISTORY_DIR, user_name)
# ensure the user history directory is inside the HISTORY_DIR
assert os.path.realpath(user_history_dir).startswith(os.path.realpath(HISTORY_DIR))
history_files = get_file_names_by_last_modified_time(
os.path.join(HISTORY_DIR, user_name)
)
Expand Down

0 comments on commit 71cb89c

Please sign in to comment.