39 private const SVG =
'svg';
56 return $this->isMimeTypeOrExtension(
75 $all_elements = $dom->getElementsByTagName(
"*");
77 for (
$i = 0;
$i < $all_elements->length;
$i++) {
78 $current_node = $all_elements->item(
$i);
80 $element_name = $original_element_name = $current_node->tagName;
81 $whitelist_attr_arr = self::$whitelist[$element_name] ?? null;
83 if ($whitelist_attr_arr !== null) {
84 for ($x = 0; $x < $current_node->attributes->length; $x++) {
85 $attribute_name = $current_node->attributes->item($x)->name;
86 if (!in_array($attribute_name, $whitelist_attr_arr)) {
87 $this->rejection_message = $this->rejection_message
88 .
' (' . $original_element_name
89 .
'/' . $attribute_name .
').';
94 $this->rejection_message = $this->rejection_message
95 .
' (' . $original_element_name .
').';
215 'color-interpolation-filters',
223 'color-interpolation-filters',
358 'preserveAspectRatio',
413 'connector-curvature',
420 'patternContentUnits',
571 'preserveAspectRatio',
608 'preserveAspectRatio',
744 'sodipodi:namedview' =>
process(FileStream $stream, Metadata $metadata)
This method gets invoked by the file upload service to process the file with the help of the processo...
__construct(?string $rejection_message=null)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const DENIED
Upload got denied by a processor, the upload will be removed immediately.
checkStream(FileStream $stream)
Class SVGWhitelistPreProcessor.
Interface FileStream The base interface for all filesystem streams.
isSVG(Metadata $metadata)