-
Notifications
You must be signed in to change notification settings - Fork 22.7k
Ensure book title/summary are not escaped twice #38675
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
Conversation
Preview URLs
(comment last updated: 2025-03-21 01:39:33) |
Is the other side of the fix coming up? We should have at least one PR that automatically closes the issue which usually is the content PR. Also, does escaping the backing string do more things than preventing HTML injection? Does it also prevent SQL injection, considering we aren't even writing raw SQL? If its only goal is to prevent HTML injection, then that should be done in the templating layer, because as you have realized the current way already causes bugs with re-updating. |
Oh yeah see it now: mdn/express-locallibrary-tutorial#305 the PR description put me off for a sec (it should be "content side" not "demo side"). I'm linking the issue to this PR. |
7f2ee15
to
7bca06e
Compare
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.
Looks like a reasonable solution to me. Thank you :)
Fix #5320
This displays the data in book detail title & summary unescaped. That's OK because the form only displays data that has already been sanitized. If we don't do this it gets sanitized on display, so we see the sanitization code we added on saving.
Demo side is: