24 include_once(
"./Services/MediaObjects/lib/svg-sanitizer-master/src/data/AttributeInterface.php");
25 include_once(
"./Services/MediaObjects/lib/svg-sanitizer-master/src/data/TagInterface.php");
26 include_once(
"./Services/MediaObjects/lib/svg-sanitizer-master/src/data/AllowedTags.php");
27 include_once(
"./Services/MediaObjects/lib/svg-sanitizer-master/src/data/AllowedAttributes.php");
28 include_once(
"./Services/MediaObjects/lib/svg-sanitizer-master/src/Sanitizer.php");
31 $dirtySVG = file_get_contents($a_file);
32 $cleanSVG = $sanitizer->sanitize($dirtySVG);
33 file_put_contents($a_file, $cleanSVG);
43 $path = realpath($a_path);
46 foreach($objects as $name => $object)
48 if (strtolower(pathinfo($name, PATHINFO_EXTENSION)) ==
"svg")
50 self::sanitizeFile($name);