SkillAgentSearch skills...

Xss

PHP filter class to prevent cross-site-scripting (XSS) vulnerabilities. Removes dangerous tags and protocols from HTML. The main difference between this class and strip_tags() or filter_var() is that you can preserve certain tags AND sanitize their attributes. Port of Drupal's XSS filter

Install / Use

/learn @ymakux/Xss
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

$filter = new Filter();

$allowed_protocols = array('http', 'ftp', 'mailto'); $allowed_tags = array('a', 'i', 'b', 'em', 'span', 'strong', 'ul', 'ol', 'li', 'table', 'tr', 'td', 'thead', 'th', 'tbody');

$filter->addAllowedProtocols($allowed_protocols); $filter->addAllowedTags($allowed_tags);

$filtered_string = $filter->xss($string);

Related Skills

View on GitHub
GitHub Stars21
CategoryDevelopment
Updated2y ago
Forks8

Languages

PHP

Security Score

75/100

Audited on Jan 20, 2024

No findings