snappdf
snappdf copied to clipboard
Sanitize HTML
It would be nice to give users the option to sanitize HTML input to prevent any leaks from the system.
Example:
function sanitizeHTML($html) {
$html = preg_replace('/<([a-zA-Z0-9]+)\s+(on\w*)="[^"]*"/i', '<$1', $html);
$blacklistTags = ['<script>', '</script>', '<iframe>', '</iframe>', '<object>', '</object>', '<embed>', '</embed>'];
$html = str_ireplace($blacklistTags, '', $html);
}