-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix lint issues to meet WordPressVIPMinimum standard #181
Conversation
/(<([^>]+)>)/gi, | ||
'' | ||
); | ||
const message = DOMPurify.sanitize( error.responseJSON.message ); |
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.
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.
const message = DOMPurify.sanitize( error.responseJSON.message ); | |
let message = error.responseJSON.message.replace( | |
/(<([^>]+)>)/gi, | |
'' | |
); | |
message = DOMPurify.sanitize( message ); |
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.
Good catch, I pushed up a fix. I took a different approach to strip the tags, using the DOMPurify
lib to not allow any tags.
/(<([^>]+)>)/gi, | ||
'' | ||
); | ||
const message = DOMPurify.sanitize( error.responseJSON.message, { |
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.
I like this, much cleaner!
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.
I think we are looking good!
Summary
Fixes #
Checklist