PHP Classes

File: usage/usage.php

Recommend this page to a friend!
  Classes of Miraz Mac  >  PHP HTML Parser and Sanitizer  >  usage/usage.php  >  Download  
File: usage/usage.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP HTML Parser and Sanitizer
Parse and clean HTML code to keep secure tags
Author: By
Last change:
Date: 1 year ago
Size: 451 bytes
 

Contents

Class file image Download
<?php

header
('Content-Type: text/html; charset=utf-8');

use
MirazMac\HtmlSanitizer\BasicWhitelist;
use
MirazMac\HtmlSanitizer\Sanitizer;
use
MirazMac\HtmlSanitizer\Whitelist;

require_once
'../vendor/autoload.php';

$whitelist = new BasicWhitelist;
$htmlsanitizer = new Sanitizer($whitelist);

//r($htmlsanitizer->getWhitelist());

$payload = file_get_contents('payload.txt');

echo
$htmlsanitizer->sanitize('<a href="#" download="true">Link</a>');