Skip to content
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

Merged
merged 3 commits into from
Jun 26, 2020

Conversation

ravichdev
Copy link
Contributor

Summary

Fixes #

Checklist

  • My pull request is addressing an open issue (please create one otherwise).
  • My code is tested and passes existing tests.
  • My code follows the Contributing Guidelines (updates are often made to the guidelines, check it out periodically).

/(<([^>]+)>)/gi,
''
);
const message = DOMPurify.sanitize( error.responseJSON.message );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to keep the stripping of tags in here. Otherwise this happens.

Screenshot 2020-06-26 at 10 37 13

Copy link
Contributor

@spacedmonkey spacedmonkey Jun 26, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const message = DOMPurify.sanitize( error.responseJSON.message );
let message = error.responseJSON.message.replace(
/(<([^>]+)>)/gi,
''
);
message = DOMPurify.sanitize( message );

Copy link
Contributor Author

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, {
Copy link
Contributor

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!

Copy link
Contributor

@spacedmonkey spacedmonkey left a 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!

@spacedmonkey spacedmonkey merged commit cff27a8 into develop Jun 26, 2020
@spacedmonkey spacedmonkey deleted the fix/lint-fixes branch June 26, 2020 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants