Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
dana321
on Feb 27, 2020
|
parent
|
context
|
favorite
| on:
Don’t try to sanitize input – escape output
In the example given there, use json_encode($name)
That will encode any data structure properly for output into JavaScript.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search:
That will encode any data structure properly for output into JavaScript.