Skip to content

Commit

Permalink
fix: complete string escaping and encoding in DropPreview
Browse files Browse the repository at this point in the history
  • Loading branch information
evegufy committed Feb 28, 2024
1 parent d44cee2 commit a030ad4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 2.1.33

- Fix incomplete string escaping and encoding in DropPreview

## 2.1.32

- Add autoFocus props to the table component
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@catena-x/portal-shared-components",
"version": "2.1.32",
"version": "2.1.33",
"description": "Catena-X Portal Shared Components",
"author": "Catena-X Contributors",
"license": "Apache-2.0",
Expand Down
4 changes: 2 additions & 2 deletions src/components/basic/Dropzone/components/DropPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ export const DropPreview: FunctionComponent<DropPreviewProps> = ({
numTotal: number
}) => {
const uploadProgress = translations.uploadProgess
.replace('%', numUploaded.toString())
.replace('%', numTotal.toString())
.replace('/%/g', encodeURIComponent(numUploaded.toString()))

Check warning

Code scanning / CodeQL

String instead of regular expression Warning

String argument
/%/g
looks like a regular expression, but it will be interpreted as a string.
.replace('/%/g', encodeURIComponent(numTotal.toString()))

Check warning

Code scanning / CodeQL

String instead of regular expression Warning

String argument
/%/g
looks like a regular expression, but it will be interpreted as a string.

return (
<Box sx={{ typography: 'label2' }}>
Expand Down

0 comments on commit a030ad4

Please sign in to comment.