class SvgSanitizerProcessor implements ProcessorInterface (View source)

Properties

protected Sanitizer $sanitizer

SVG sanitizer.

protected SanitizerOptions $sanitizerOptions

SVG sanitizer options.

Methods

__construct(Sanitizer $sanitizer, SanitizerOptions $sanitizerOptions)

Initialize the instance.

bool
shouldProcess(Version $version)

Check if a file version should be processed (it must be an SVG image).

process(Version $version)

Remove potentially harmful elements and attributes from the SVG image.

Details

__construct(Sanitizer $sanitizer, SanitizerOptions $sanitizerOptions)

Initialize the instance.

Parameters

Sanitizer $sanitizer
SanitizerOptions $sanitizerOptions

bool shouldProcess(Version $version)

Check if a file version should be processed (it must be an SVG image).

{@inheritdoc}

Parameters

Version $version

Return Value

bool

See also

ProcessorInterface::shouldProcess

process(Version $version)

Remove potentially harmful elements and attributes from the SVG image.

{@inheritdoc}

Parameters

Version $version

See also

ProcessorInterface::process