Fixes #37582 - use textarea in host comment edit
Had to change the css since for long inputs the comment text would go out of the card border. Added set default on submit so if a user changes the comment, saves, and then changes it again but clicks the cancel it wont go to the value that the page loaded
added white-space: pre-line; so that the comment view will show newlines
Nice. Thank you. Is there a validation / check somewhere to prevent XSS?
By default, React DOM escapes any values embedded in JSX before rendering them. (https://legacy.reactjs.org/docs/introducing-jsx.html#jsx-prevents-injection-attacks) Is there other risk I didnt see?
By default, React DOM escapes any values embedded in JSX before rendering them. (https://legacy.reactjs.org/docs/introducing-jsx.html#jsx-prevents-injection-attacks) Is there other risk I didnt see?
Oh, this is great. Thank you very much.
Do we somewhere have a XSS tests which tries to inject certain JS stuff in textarea / other user-defined input fields and then tries to find out if the JS would be escaped / not espaced?
I tested this and what happens is:
- If I enter a comment value and submit, that is fine.
- When I edit the comment and submit, that is also fine.
- When I edit the comment a third time and then click abort, then the first value that I initially added in the current session re-appears instead the one I added in 2)
Do we somewhere have a XSS tests which tries to inject certain JS stuff in textarea / other user-defined input fields and then tries to find out if the JS would be escaped / not espaced?
Not in our tests in the repo, since we use textarea from react/rails which should be secure for that.
When I edit the comment a third time and then click abort, then the first value that I initially added in the current session re-appears instead the one I added in 2)
Thanks, had a typo in the function call, should be good now
Thanks, had a typo in the function call, should be good now
Works now, thanks!