PHP code example of masterro / laravel-xss-filter
1. Go to this page and download the library: Download masterro/laravel-xss-filter library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once ('vendor/autoload.php' );
masterro / laravel-xss-filter example snippets
<html>
<head>
<script src="app.js" ></script>
<script>window.init()</script>
<meta name="test" />
<script>
let Iframe = new Iframe('#iframe' );
</script>
<head>
<body>
<div class ="hover " onhover ="show ()" data -a ="b "><p onclick ="click "><span class ="span " ondblclick ="hide ()"></span >Aawfawfaw f awf aw </p ></div >
<iframe id ="iframe ">Not supported !</iframe >
</body >
</html >
<html>
<head>
<script src="app.js"></script>
<script>window.init()</script>
<meta name="test" />
<script>
let Iframe = new Iframe(&
</script>
<head>
<body>
<div class ="hover " data -a ="b "><p ><span class ="span " ></span >Aawfawfaw f awf aw </p ></div >
< ;iframe id =" ;iframe " ;> ;Not supported !< ;/iframe > ;
</body >
</html >
public function boot () : void
{
Livewire::setUpdateRoute(static function ($handle) {
return Route::post('/livewire/update' , $handle)
->middleware(['web' , FilterXSSLivewire::class]);
});
}
public function boot () : void
{
Livewire::addPersistentMiddleware([
FilterXSSLivewire::class,
]);
}
$clean = XSSCleaner::clean($string);
XSSCleaner::config()
->allowElement('iframe' )
->allowMediaHosts(['youtube.com' , 'youtu.be' ])
->denyElement('a' );
$clean = XSSCleaner::clean($string);
php artisan vendor:publish --provider="MasterRO\LaravelXSSFilter\XSSFilterServiceProvider"