Login   Register  
PHP Classes
elePHPant
Icontem

HTML Sanitizer: Remove unsafe tags and attributes from HTML code

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us

  Author Author  
Picture of Frédéric Minne
Name: Frédéric Minne <contact>
Classes: 2 packages by
Country: Belgium Belgium
Age: 35
All time rank: 5301 in Belgium Belgium
Week rank: 744 Down3 in Belgium Belgium Down


  Detailed description   Download Download .zip .tar.gz  
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.0
PHP version: 4
License: GNU General Public License (GPL)
All time users: 3162 users
All time rank: 1043
Week users: 2 users
Week rank: 852 Up
 
  Groups   Rate classes User ratings   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


  User ratings  
RatingsUtility Consistency Documentation Examples Tests Videos Overall Rank
All time: Good (87%) Good (87%) - Sufficient (70%) - - Not sure (59%) 918
Month: Not yet rated by the users

  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 sample.php Example Example
Plain text file sanitizer.class.php Class HTML_Sanitizer class

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.