Which HTML attribute is crucial for preventing XSS in user-generated content?

  • href
  • htmlspecialchars
  • rel
  • src
The htmlspecialchars function in PHP is crucial for preventing XSS in user-generated content. It converts special characters to HTML entities, preventing the browser from interpreting them as code. This helps to neutralize potential XSS attacks.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *