|
ILIAS
trunk Revision v13.0_alpha-62-g3b72d83f2e5
|
Standard implementation of the filename sanitizing interface. More...
Inheritance diagram for ILIAS\Filesystem\Security\Sanitizing\DefaultFilenameSanitizer:
Collaboration diagram for ILIAS\Filesystem\Security\Sanitizing\DefaultFilenameSanitizer:Public Member Functions | |
| __construct (private FilesystemConfig $settings) | |
| 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 | |
| getWhitelistedSuffixes () | |
| extractFileSuffix (string $filename) | |
| Extracts the suffix from the given filename. More... | |
Private Attributes | |
| array | $whitelist = null |
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 32 of file DefaultFilenameSanitizer.php.
| ILIAS\Filesystem\Security\Sanitizing\DefaultFilenameSanitizer::__construct | ( | private FilesystemConfig | $settings | ) |
Definition at line 36 of file DefaultFilenameSanitizer.php.
|
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 123 of file DefaultFilenameSanitizer.php.
References $filename.
Referenced by ILIAS\Filesystem\Security\Sanitizing\DefaultFilenameSanitizer\isClean().
Here is the caller graph for this function:
|
private |
Definition at line 42 of file DefaultFilenameSanitizer.php.
References ILIAS\Filesystem\Security\Sanitizing\DefaultFilenameSanitizer\$whitelist, ILIAS\Filesystem\Security\Sanitizing\FilenameSanitizer\CLEAN_FILE_SUFFIX, and ILIAS\Repository\settings().
Referenced by ILIAS\Filesystem\Security\Sanitizing\DefaultFilenameSanitizer\isClean().
Here is the call graph for this function:
Here is the caller graph for this function:| ILIAS\Filesystem\Security\Sanitizing\DefaultFilenameSanitizer::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 74 of file DefaultFilenameSanitizer.php.
References $filename, ILIAS\Filesystem\Security\Sanitizing\DefaultFilenameSanitizer\extractFileSuffix(), and ILIAS\Filesystem\Security\Sanitizing\DefaultFilenameSanitizer\getWhitelistedSuffixes().
Referenced by ILIAS\Filesystem\Security\Sanitizing\DefaultFilenameSanitizer\sanitize().
Here is the call graph for this function:
Here is the caller graph for this function:| ILIAS\Filesystem\Security\Sanitizing\DefaultFilenameSanitizer::sanitize | ( | string | $filename | ) |
@inheritDoc
Implements ILIAS\Filesystem\Security\Sanitizing\FilenameSanitizer.
Definition at line 93 of file DefaultFilenameSanitizer.php.
References $filename, ILIAS\Filesystem\Security\Sanitizing\FilenameSanitizer\CLEAN_FILE_SUFFIX, ILIAS\Filesystem\Security\Sanitizing\DefaultFilenameSanitizer\isClean(), and ILIAS\Filesystem\Util\sanitizeFileName().
Here is the call graph for this function:
|
private |
Definition at line 34 of file DefaultFilenameSanitizer.php.
Referenced by ILIAS\Filesystem\Security\Sanitizing\DefaultFilenameSanitizer\getWhitelistedSuffixes().