HTML sanitization
Appearance
This article needs additional citations for verification. (December 2009) |
HTML sanitization is the process of examining an HTML document and producing a new HTML document that preserves only whatever tags are designated "safe". HTML sanitization can be used to protect against cross-site scripting and SQL injection attacks by sanitizing any HTML code submitted by a user.
Tags often allowed are <b>, <i>, <u>, <em>, and <strong>.
In PHP this can be performed using the strip_tags()
function.[1]
References