Skip to content

Commit

Permalink
Improved pathchooser
Browse files Browse the repository at this point in the history
  • Loading branch information
Ozzie Isaacs committed Jul 9, 2023
1 parent 5007580 commit fdd1410
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cps/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
from urllib.parse import urlparse

from flask import Blueprint, flash, redirect, url_for, abort, request, make_response, send_from_directory, g, Response
from flask import Markup
from flask_login import login_required, current_user, logout_user
from flask_babel import gettext as _
from flask_babel import get_locale, format_time, format_datetime, format_timedelta
Expand Down Expand Up @@ -1035,7 +1036,8 @@ def pathchooser():

for f in folders:
try:
data = {"name": f, "fullpath": os.path.join(cwd, f)}
sanitized_f = str(Markup.escape(f))
data = {"name": sanitized_f, "fullpath": os.path.join(cwd, sanitized_f)}
data["sort"] = data["fullpath"].lower()
except Exception:
continue
Expand Down

0 comments on commit fdd1410

Please sign in to comment.