alnorris / SVG-Sanitizer

Whitelist-based PHP SVG sanitizer.
MIT License
22 stars 5 forks source link

SVG Sanitizer

Whitelist-based PHP SVG sanitizer.

Usage

<?php

// load
require_once('SvgSanitizer.php');
$svg = new SvgSanitizer();

// load SVG
$svg->load("evil.svg");

// sanitize!
$svg->sanitize();

// Print out sanitized SVG
echo $svg->saveSVG();

?>

License

MIT