PHP Classes

Anti XSS Atacks: Clean request values to avoid security attacks

Recommend this page to a friend!
  Info   View files Example   View files View files (2)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStarStar 60%Total: 838 All time: 4,142 This week: 59Up
Version License PHP version Categories
antixss-attacks 1.0GNU General Publi...5.0E-Commerce, Text processing, Validation, S...
Description 

Author

This class can clean request values to avoid security attacks.

It can take the current request values and filter them to avoid character sequences that can cause security problems.

Currently it can strip HTML tags, encode special HTML characters, sanitize string values, filter email addresses, remove letters with accents and cedillas, replace symbol characters, replace special JavaScript characters, etc.

Picture of Evert Ulises German Soto
  Performance   Level  
Name: Evert Ulises German Soto <contact>
Classes: 3 packages by
Country: Mexico Mexico
Age: 39
All time rank: 5817 in Mexico Mexico
Week rank: 305 Up2 in Mexico Mexico Up

Example

<?php
//First of all, must be include the file class
require("antixss.class.php");

//Creating instance
$xss = new wArLeY_AntiXSS();

//If you need clean your $_GET array you cant test something like this
foreach($_GET AS $key=>$value){
    echo
"<div style='border:1px solid #FE0000;margin-top:5px;'>". $xss->clean($_GET[$key], array('prevent_basic_xss', 'filter_sanitize')) ."</div>";
}

/*
Note:
    The unique method "clean" in the class need 2 params
    1.- The STRING that you need clean
    2.- An array with the clean methods, the methods are execute in the relative order provided.
   
    Existant methods:
    * prevent_basic_xss
    * html_special_character
    * stripe_tags
    * stripe_slashes
    * filter_sanitize
    * filter_email
    * rare_accent
    * special_character
    * allowed_by_os

    The array can content one or more methods to execute.
   
    Protect you and enjoy!
*/
?>


  Files folder image Files  
File Role Description
Plain text file antixss.class.php Class Class file Anti XSS Atacks
Accessible without login Plain text file example.php Example How to use anti xss class

 Version Control Unique User Downloads Download Rankings  
 0%
Total:838
This week:0
All time:4,142
This week:59Up
User Ratings User Comments (1)
 All time
Utility:87%StarStarStarStarStar
Consistency:81%StarStarStarStarStar
Documentation:-
Examples:81%StarStarStarStarStar
Tests:-
Videos:-
Overall:60%StarStarStarStar
Rank:1206
 
clean, well written; thanks
9 years ago (Jack Rowe)
67%StarStarStarStar