class SecurityFileUploadEventSubscriber implements EventSubscriberInterface (View source)

The final subscriber to 'file.upload.sanitize.name'.

This prevents insecure filenames.

Properties

protected Config $config

The system.file configuration.

Methods

__construct(ConfigFactoryInterface $config_factory)

Constructs a new file event listener.

static 
getSubscribedEvents()

{@inheritdoc}

void
sanitizeName(FileUploadSanitizeNameEvent $event)

Sanitizes the upload's filename to make it secure.

Details

__construct(ConfigFactoryInterface $config_factory)

Constructs a new file event listener.

Parameters

ConfigFactoryInterface $config_factory

The config factory.

static getSubscribedEvents()

{@inheritdoc}

void sanitizeName(FileUploadSanitizeNameEvent $event)

Sanitizes the upload's filename to make it secure.

Parameters

FileUploadSanitizeNameEvent $event

File upload sanitize name event.

Return Value

void