FileExtensionFilter
class \
Utility methods for filtering filenames
Table of Contents
Properties
- $allowedFileExtensions : array
- Allowed file extensions. If NULL, all extensions are allowed.
- $disallowedFileExtensions : array
- Disallowed file extensions. If NULL, no extension is disallowed (i.e. all are allowed).
Methods
- filterFileList() : bool|int
- Entry method for use as filelist filter.
- filterInlineChildren() : array
- Entry method for use as DataHandler "inline" field filter
- isAllowed() : bool
- Checks whether a file is allowed according to the criteria defined in the class variables ($this->allowedFileExtensions etc.)
- setAllowedFileExtensions() : mixed
- Set allowed file extensions
- setDisallowedFileExtensions() : mixed
- Set disallowed file extensions
- convertToLowercaseArray() : array
- Converts mixed (string or array) input arguments into an array, NULL if empty.
Properties
$allowedFileExtensions
Allowed file extensions. If NULL, all extensions are allowed.
protected
array
$allowedFileExtensions
$disallowedFileExtensions
Disallowed file extensions. If NULL, no extension is disallowed (i.e. all are allowed).
protected
array
$disallowedFileExtensions
Methods
filterFileList()
Entry method for use as filelist filter.
public
filterFileList(string $itemName, string $itemIdentifier, string $parentIdentifier, array $additionalInformation, DriverInterface $driver) : bool|int
We use -1 as the "don't include“ return value, for historic reasons, as call_user_func() used to return FALSE if calling the method failed.
Parameters
- $itemName : string
- $itemIdentifier : string
- $parentIdentifier : string
- $additionalInformation : array
-
Additional information about the inspected item
- $driver : DriverInterface
Return values
bool|int —-1 if the file should not be included in a listing
filterInlineChildren()
Entry method for use as DataHandler "inline" field filter
public
filterInlineChildren(array $parameters, DataHandler $dataHandler) : array
Parameters
- $parameters : array
- $dataHandler : DataHandler
Return values
arrayisAllowed()
Checks whether a file is allowed according to the criteria defined in the class variables ($this->allowedFileExtensions etc.)
public
isAllowed(string $fileExt) : bool
Parameters
- $fileExt : string
Internal
this is used internally for TYPO3 core only
Return values
boolsetAllowedFileExtensions()
Set allowed file extensions
public
setAllowedFileExtensions(mixed $allowedFileExtensions) : mixed
Parameters
- $allowedFileExtensions : mixed
-
Comma-separated list or array, of allowed file extensions
setDisallowedFileExtensions()
Set disallowed file extensions
public
setDisallowedFileExtensions(mixed $disallowedFileExtensions) : mixed
Parameters
- $disallowedFileExtensions : mixed
-
Comma-separated list or array, of allowed file extensions
convertToLowercaseArray()
Converts mixed (string or array) input arguments into an array, NULL if empty.
protected
convertToLowercaseArray(mixed $inputArgument) : array
All array values will be converted to lower case.
Parameters
- $inputArgument : mixed
-
Comma-separated list or array.