65 $basename = $pathInfo[
'basename'];
66 $parentPath = $pathInfo[
'dirname'];
69 $filename = str_replace(
'.',
'', $basename);
73 if ($parentPath ===
'') {
77 return "$parentPath/$filename";
90 return strtolower(pathinfo(
$filename, PATHINFO_EXTENSION));
104 throw new ilException(
"Filename must not be null to get sanitized!");
An exception for terminatinating execution or to throw for unit testing.
__construct()
FilenameSanitizerImpl constructor.
isClean($filename)
@inheritDoc
$whitelist
Contains the whitelisted file suffixes.
sanitize($filename)
@inheritDoc
extractFileSuffix($filename)
Extracts the suffix from the given filename.
validateFilename($filename)
Validates that the filename is valid for further sanitizing.
Base class for ILIAS Exception handling.
static getValidExtensions()
Valid extensions.
const CLEAN_FILE_SUFFIX
This file suffix will be used to sanitize not whitelisted file names.