39 private const SVG =
'svg';
43 public function __construct(?
string $rejection_message = null)
50 return $this->isMimeTypeOrExtension(
69 $all_elements = $dom->getElementsByTagName(
"*");
71 for (
$i = 0;
$i < $all_elements->length;
$i++) {
72 $current_node = $all_elements->item(
$i);
74 $element_name = $original_element_name = $current_node->tagName;
75 $whitelist_attr_arr = self::$whitelist[$element_name] ?? null;
77 if ($whitelist_attr_arr !== null) {
78 for ($x = 0; $x < $current_node->attributes->length; $x++) {
79 $attribute_name = $current_node->attributes->item($x)->name;
80 if (!in_array($attribute_name, $whitelist_attr_arr)) {
81 $this->rejection_message = $this->rejection_message
82 .
' (' . $original_element_name
83 .
'/' . $attribute_name .
').';
88 $this->rejection_message = $this->rejection_message
89 .
' (' . $original_element_name .
').';
209 'color-interpolation-filters',
217 'color-interpolation-filters',
352 'preserveAspectRatio',
407 'connector-curvature',
414 'patternContentUnits',
565 'preserveAspectRatio',
602 'preserveAspectRatio',
738 '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)
string $rejection_message
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.
isSVG(Metadata $metadata)