Skip to content

terrylinooo/web-security

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Shieldon Web-Security

Build Status codecov License: MIT

This package is a part of Shieldon Firewall 2.

Installation

Use PHP Composer:

composer require shieldon/web-security

Or, download it and include the Shieldon autoloader.

require 'autoload.php';

Usage

Clean single variable

$xss = new \Shieldon\Security\Xss();

$_POST['username'] = 'javascript:/*--></title></style></textarea></script></xmp><svg/onload=\'+/"/+/onmouseover=1/+/[*/[]/+alert(1)//\'>';

$username = $xss->clean($_POST['username']);

echo $username;

result

[removed]/*--&gt;&lt;/title&gt;&lt;/style&gt;&lt;/textarea&gt;[removed]</xmp>&lt;svg/[removed]&gt;

Clean a superglobal

$xss = new \Shieldon\Security\Xss();

$_GET = $xss->clean($_GET);

Author

License

MIT

About

XSS protection for Shieldon firewall v2.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages