// Output an unsafe string, presumably user input
$xss = '<script type="text/javascript"><!--mce:0--></script>';
echo 'If your entered your name as ' . $xss . ', we\'d be in trouble.
' . "\n";
// Sanitize that string, and output it safely
$htmlContentContext = sgSanitizer::sanitizeForHTMLContent($xss);
echo "But if we sanitize your name, " . $htmlContentContext . ", then all is well.
\n"; |
// Output an unsafe string, presumably user input
$xss = '<script type="text/javascript"><!--mce:0--></script>';
echo 'If your entered your name as ' . $xss . ', we\'d be in trouble.
' . "\n";
// Sanitize that string, and output it safely
$htmlContentContext = sgSanitizer::sanitizeForHTMLContent($xss);
echo "But if we sanitize your name, " . $htmlContentContext . ", then all is well.
\n";
Descargar la librería