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

Avoid unsafe behavior in example code #21

Merged
merged 1 commit into from Mar 9, 2016

Conversation

cesarandreu
Copy link
Contributor

This is probably a minor nit... But I worry that people will follow an unsafe example because they don't know any better. I definitely would've fallen into that trap not so long ago.

My suggested change is to replace JSON.stringify with serialize-javascript, which does automatic escaping of HTML characters.

I don't know if just using it in the example is enough, or if it would be a good idea to add a note / warning.

markdalgleish added a commit that referenced this pull request Mar 9, 2016
Avoid unsafe behavior in example code
@markdalgleish markdalgleish merged commit 4873d34 into markdalgleish:master Mar 9, 2016
@markdalgleish
Copy link
Owner

I actually fell into this trap myself, too. Thanks for the PR.

@cesarandreu cesarandreu deleted the patch-1 branch March 9, 2016 23:27
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.

None yet

2 participants