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

Two minor changes from internal #8855

Merged
merged 1 commit into from Jan 24, 2017
Merged

Two minor changes from internal #8855

merged 1 commit into from Jan 24, 2017

Conversation

sophiebits
Copy link
Collaborator

No description provided.

@gaearon
Copy link
Collaborator

gaearon commented Jan 24, 2017

This didn’t flow well.

@gaearon gaearon mentioned this pull request Jan 24, 2017
@@ -465,7 +465,7 @@ var ReactDOMFiberComponent = {
// Create the script via .innerHTML so its "parser-inserted" flag is
// set to true and it does not execute
var div = ownerDocument.createElement('div');
div.innerHTML = '<script></script>';
div.innerHTML = '<script><' + '/script>'; // eslint-disable-line
Copy link
Contributor

Choose a reason for hiding this comment

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

Hi, I am curious. What's that concatenation for? Is it a security-related thing?

Copy link

Choose a reason for hiding this comment

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

I'm curious about this too... 🤔

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It is to avoid this class of bug when inlining the full React source into a <script> tag: https://sophiebits.com/2012/08/03/preventing-xss-json.html.

Really the fix should not be made here though, this was really a hack.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants