Skip to content

Commit

Permalink
replace the hardcoded filename with correct text (#3957)
Browse files Browse the repository at this point in the history
Co-authored-by: Mohammed Tabraiz <tabraiz@cloudera.com>
  • Loading branch information
tabraiz12 and Mohammed Tabraiz authored Jan 15, 2025
1 parent b2b0023 commit a178e77
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('&#96;', '`');

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

0 comments on commit a178e77

Please sign in to comment.