This repository has been archived by the owner on Feb 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 219
Sanitize error message html #7145
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
a732841
Sanitize error mesage html
hsingyuc edbbfd3
Add dompurify as dependency
hsingyuc 6c71ebe
Rebase and fix package lock file
hsingyuc 01b4a0f
Add link style to notices
hsingyuc 611fd11
Merge branch 'trunk' into fix/woopay-1130
hsingyuc 630803b
Merge branch 'trunk' into fix/woopay-1130
hsingyuc 458eb07
Merge branch 'trunk' into fix/woopay-1130
hsingyuc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hsingyuc While working on #7147, I was reusing this part. When looking at
ALLOWED_TAGS
andALLOWED_ATTR
, I noticed that they're not working as expected. https://github.com/cure53/DOMPurify#can-i-configure-dompurify shows the following example:Looking at the implementation above, I'd say that the current implementation would lead to this function call:
I believe the function should be called like this instead:
If that assumption is correct, I suggest the following change:
cc: @opr and @wavvves
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nielslange, in ES6, it converts to below. If converted to the way you wrote, I believe we will get an error.