PHP Classes

PHP HTML Parser and Sanitizer: Parse and clean HTML code to keep secure tags

Recommend this page to a friend!
  Info   View files Example   View files View files (12)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2021-07-25 (4 months ago) RSS 2.0 feedNot enough user ratingsTotal: 78 All time: 9,797 This week: 220Up
Version License PHP version Categories
html-sanitizer 1.0.0MIT/X Consortium ...7HTML, PHP 5, Security
Description Author

This package can parse and clean HTML code to keep only secure tags.

It can take a string with HTML code and parse it to keep only the tags it considers secure. But you can also define your custom whitelist.

It provides a base whitelist class that returns the values that should be considered secure, like protocols used in URLs and HTML tags and attributes.

Picture of Miraz Mac
  Performance   Level  
Name: Miraz Mac <contact>
Classes: 13 packages by
Country: Bangladesh Bangladesh
Age: 27
All time rank: 209131 in Bangladesh Bangladesh
Week rank: 151 Up3 in Bangladesh Bangladesh Up
Innovation award
Innovation award
Nominee: 5x

  Files folder image Files  
File Role Description
Files folder imagebench (2 files)
Files folder imagesrc (4 files)
Files folder imagetests (1 file)
Files folder imageusage (2 files)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file composer.lock Data Auxiliary data
Accessible without login Plain text file phpunit.xml Data Auxiliary data

  Files folder image Files  /  bench  
File Role Description
  Accessible without login HTML file payload.html Doc. Documentation
  Accessible without login Plain text file run.php Example Example script

  Files folder image Files  /  src  
File Role Description
  Plain text file BasicWhitelist.php Class Class source
  Plain text file HtmlDataMap.php Class Class source
  Plain text file Sanitizer.php Class Class source
  Plain text file Whitelist.php Class Class source

  Files folder image Files  /  tests  
File Role Description
  Plain text file SanitizerTest.php Class Class source

  Files folder image Files  /  usage  
File Role Description
  Accessible without login Plain text file payload.txt Data Test HTML data file
  Accessible without login Plain text file usage.php Example Example script

 Version Control Unique User Downloads Download Rankings  
 100%
Total:78
This week:0
All time:9,797
This week:220Up
For more information send a message to info at phpclasses dot org.