1. Go to this page and download the library: Download medilies/xssless 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');
/* Start to develop here. Best regards https://php-download.com/ */
medilies / xssless example snippets
$config = new Medilies\Xssless\Dompurify\DompurifyCliConfig('node', 'npm');
(new Medilies\Xssless\Xssless)
->using($config)
->setup();
(new Medilies\Xssless\Xssless)
->using(new Medilies\Xssless\Dompurify\DompurifyCliConfig)
->clean($html);
$config = new Medilies\Xssless\Dompurify\DompurifyServiceConfig(
host: '127.0.0.1',
port: 63000
);
$xssless = (new Medilies\Xssless\Xssless)
->using($config);
/**
* It is better to have this part in a separate script
* that runs continuously and independently from your app
*/
$xssless->start();
$xssless->clean($html);