Rumah > pembangunan bahagian belakang > tutorial php > 一个快速的XSS消除PHP库:Stauros

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

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Lepaskan: 2016-06-23 13:27:08
asal
871 orang telah melayarinya

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);
Salin selepas log masuk

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);
Salin selepas log masuk

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

$stauros->scanHTMLStreamToStream($input, $output);
Salin selepas log masuk

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

sumber:php.cn
Kenyataan Laman Web ini
Kandungan artikel ini disumbangkan secara sukarela oleh netizen, dan hak cipta adalah milik pengarang asal. Laman web ini tidak memikul tanggungjawab undang-undang yang sepadan. Jika anda menemui sebarang kandungan yang disyaki plagiarisme atau pelanggaran, sila hubungi admin@php.cn
Tutorial Popular
Lagi>
Muat turun terkini
Lagi>
kesan web
Kod sumber laman web
Bahan laman web
Templat hujung hadapan