AllowedFileExtensions

final readonly class \TYPO3\CMS\Core\Resource\Security\AllowedFileExtensions

The file extensions a file storage or file mount restricts added files to.

An empty list given by configuration means no restriction.

Table of Contents

Methods

allowsFileExtension()  : bool
allowsFileName()  : bool
fromList()  : self
intersect()  : self
Restrictions of different levels, such as a storage and its file mounts, narrow each other: the result allows what both allow, which may be nothing.
isRestricted()  : bool
merge()  : self
Permissions of file mounts add up: the result allows what any of both allows, which means no restriction if one of them is unrestricted.
toList()  : array<int, non-empty-string>
toString()  : string
unrestricted()  : self

Methods

allowsFileExtension()

public allowsFileExtension(string $fileExtension) : bool

Parameters

$fileExtension : string

Return values

bool

allowsFileName()

public allowsFileName(string $fileName) : bool

Parameters

$fileName : string

Return values

bool

fromList()

public static fromList(string|array<int, string> $fileExtensions) : self

Parameters

$fileExtensions : string|array<int, string>

A list or a comma-separated string

Return values

self

intersect()

Restrictions of different levels, such as a storage and its file mounts, narrow each other: the result allows what both allow, which may be nothing.

public intersect(self $other) : self

Parameters

$other : self

Return values

self

isRestricted()

public isRestricted() : bool

Return values

bool

merge()

Permissions of file mounts add up: the result allows what any of both allows, which means no restriction if one of them is unrestricted.

public merge(self $other) : self

Parameters

$other : self

Return values

self

toList()

public toList() : array<int, non-empty-string>

Return values

array<int, non-empty-string> —

empty if unrestricted, or if nothing is allowed

toString()

public toString() : string

Return values

string

unrestricted()

public static unrestricted() : self

Return values

self
On this page