Skip to content

Commit

Permalink
replace the hardcoded filename with correct text
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohammed Tabraiz committed Jan 15, 2025
1 parent b2b0023 commit d6453ca
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@
// In this case we don't want to sanitize the path for XSS as we want exact match on the actual file name,
// so to prevent breaking the page on substitution we enforce a js compatible string by only encoding the backtick
// char (`) with a js decode to restore it in case file actually has backtick in the name.
const decodedPath = `/user/admin/ai_case.txt`.replaceAll('`', '`');

const decodedPath = FileViewOptions.path.replaceAll('`', '`');
const encodedPath = encodeURIComponent(decodedPath);
const pathPrefix = "/filebrowser/view=";
const contentPath = pathPrefix+encodedPath;
Expand Down

0 comments on commit d6453ca

Please sign in to comment.