PHP Classes
elePHPant
Icontem

HTML Sanitizer: Remove unsafe tags and attributes from HTML code

Recommend this page to a friend!

  Author Author  
Picture of Frédéric Minne
Name: Frédéric Minne <contact>
Classes: 2 packages by
Country: Belgium Belgium


  Detailed description   Download Download .zip .tar.gz   Install with Composer Install with Composer  
This class can be used to remove unsafe tags and attributes from HTML code.

It takes a string with HTML code and strips all the tags that do not make part of a list of safe tags. That list of safe tags is defined as a private class variable. There are some functions to allow usually unsafe tags like script, style, object, embed, etc..

The class can also remove unsafe tag attributes, such as those that define Javascript code to handle events.

The links href attributes also gets special treatment to remove URLs that trigger Javascript code execution and line breaks.

  Classes of Frédéric Minne  >  HTML Sanitizer  >  Download Download .zip .tar.gz  >  Support forum Support forum (3)  >  Blog Blog  >  RSS 1.0 feed RSS 2.0 feed Latest changes  
Name: HTML Sanitizer
Base name: htmlsanitizer
Description: Remove unsafe tags and attributes from HTML code
Version: 1.3
PHP version: 5.2
License: GNU General Public License (GPL)
 
  Groups   Trackback   Applications   Files Files  

  Groups  
Group folder image HTML HTML generation and processing View top rated classes
Group folder image Security Security protection and attack detection View top rated classes


  Pages that reference this package  
PHP SQL Injection and XSS detection program
-
PHP Security
PHP code security and XSS, SQL injection and other types of sites for the safety of a very used, in particular, UGC (User Generated Content) sites, forums and e-commerce sites, often XSS and SQL injection is the hardest hit...
PHP SQL Injection and XSS detection program
-

Latest pages that reference packages Latest pages that reference packages


  Applications that use this package  
No pages of applications that use this class were specified.

Add link image If you know an application of this package, send a message to the author to add a link here.

  Files folder image Files  
File Role Description
Accessible without login Plain text file COPYING Lic. GNU LGPL
Accessible without login Plain text file helpers.lib.php Aux. Auxiliary script
Plain text file HTML_Sanitizer.php Class Class source
Accessible without login Plain text file README.md Doc. Documentation
Accessible without login Plain text file sample.php Example Example

Install with Composer Install with Composer - Download Download all files: htmlsanitizer.tar.gz htmlsanitizer.zip
NOTICE: if you are using a download manager program like 'GetRight', please Login before trying to download this archive.