|
ILIAS
trunk Revision v12.0_alpha-377-g3641b37b9db
|
Standard implementation of the filename sanitizing interface. More...
Inheritance diagram for ILIAS\Filesystem\Security\Sanitizing\FilenameSanitizerImpl:
Collaboration diagram for ILIAS\Filesystem\Security\Sanitizing\FilenameSanitizerImpl:Public Member Functions | |
| __construct (private array $whitelist) | |
| FilenameSanitizerImpl constructor. More... | |
| isClean (string $filename) | |
| Checks if the filename is prefixed with a valid whitelisted ending. More... | |
| sanitize (string $filename) | |
| @inheritDoc More... | |
| isClean (string $filename) | |
| Checks if the filename is prefixed with a valid whitelisted ending. More... | |
| sanitize (string $filename) | |
| Validates the file ending, with the filesystem whitelist provided by ILIAS. More... | |
Private Member Functions | |
| extractFileSuffix (string $filename) | |
| Extracts the suffix from the given filename. More... | |
Additional Inherited Members | |
Data Fields inherited from ILIAS\Filesystem\Security\Sanitizing\FilenameSanitizer | |
| const | CLEAN_FILE_SUFFIX = 'sec' |
| This file suffix will be used to sanitize not whitelisted file names. More... | |
Standard implementation of the filename sanitizing interface.
Definition at line 31 of file FilenameSanitizerImpl.php.
| ILIAS\Filesystem\Security\Sanitizing\FilenameSanitizerImpl::__construct | ( | private array | $whitelist | ) |
FilenameSanitizerImpl constructor.
| string[] | $whitelist |
| $whitelist | Contains the whitelisted file suffixes. |
Definition at line 37 of file FilenameSanitizerImpl.php.
References ILIAS\Filesystem\Security\Sanitizing\FilenameSanitizer\CLEAN_FILE_SUFFIX.
|
private |
Extracts the suffix from the given filename.
If no suffix was found an empty string will be returned.
| string | $filename | The filename which should be used to extract the file suffix. |
Definition at line 93 of file FilenameSanitizerImpl.php.
References $filename.
Referenced by ILIAS\Filesystem\Security\Sanitizing\FilenameSanitizerImpl\isClean().
Here is the caller graph for this function:| ILIAS\Filesystem\Security\Sanitizing\FilenameSanitizerImpl::isClean | ( | string | $filename | ) |
Checks if the filename is prefixed with a valid whitelisted ending.
| string | $filename | The filename which should be checked for a whitelisted ending. |
Implements ILIAS\Filesystem\Security\Sanitizing\FilenameSanitizer.
Definition at line 50 of file FilenameSanitizerImpl.php.
References ILIAS\Filesystem\Security\Sanitizing\FilenameSanitizerImpl\extractFileSuffix().
Referenced by ILIAS\Filesystem\Security\Sanitizing\FilenameSanitizerImpl\sanitize().
Here is the call graph for this function:
Here is the caller graph for this function:| ILIAS\Filesystem\Security\Sanitizing\FilenameSanitizerImpl::sanitize | ( | string | $filename | ) |
@inheritDoc
Implements ILIAS\Filesystem\Security\Sanitizing\FilenameSanitizer.
Definition at line 63 of file FilenameSanitizerImpl.php.
References $filename, ILIAS\Filesystem\Security\Sanitizing\FilenameSanitizer\CLEAN_FILE_SUFFIX, ILIAS\Filesystem\Security\Sanitizing\FilenameSanitizerImpl\isClean(), and ILIAS\Filesystem\Util\sanitizeFileName().
Here is the call graph for this function: