2 declare(strict_types=1);
58 if ($this->
isClean($filename)) {
62 $pathInfo = pathinfo($filename);
63 $basename = $pathInfo[
'basename'];
64 $parentPath = $pathInfo[
'dirname'];
67 $filename = str_replace(
'.',
'', $basename);
71 if ($parentPath ===
'') {
75 return "$parentPath/$filename";
88 return strtolower(pathinfo(
$filename, PATHINFO_EXTENSION));
extractFileSuffix($filename)
Extracts the suffix from the given filename.
isClean(string $filename)
__construct()
FilenameSanitizerImpl constructor.
const CLEAN_FILE_SUFFIX
This file suffix will be used to sanitize not whitelisted file names.
static getValidExtensions()
Valid extensions.
sanitize(string $filename)