Home > Backend Development > PHP Tutorial > 一个快速的XSS消除PHP库:Stauros

一个快速的XSS消除PHP库:Stauros

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-23 13:27:08
Original
872 people have browsed it

Stauros

一个快速的XSS消除PHP库.

IMPORTANT

THIS IS AN EXPERIMENTAL LIBRARY, USE AT YOUR OWN RISK

How to use it

With the default settings, simply callStauros->scanHTML():

$stauros = new Stauros;$clean = $stauros->scanHTML($dirty);
Copy after login

Easy as that

Working with streams

Stauros supports streaming content as well. You can use a stream as input, getting a string as output:

$clean = $stauros->scanHTMLStreamToString($stream);
Copy after login

Or you can use it as a stream to stream process:

$stauros->scanHTMLStreamToStream($input, $output);
Copy after login

Advanced Usage

The configuration class (Stauros\HTML\Config) allows you to specify html tag whitelists, as well as attribute whitelist and implement an attribute callback for further customization.

项目主页:http://www.open-open.com/lib/view/home/1441378271175

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template