This repository has been archived by the owner on Jan 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
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
License
ymakux/xss
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
$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);
About
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
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published