2 namespace TYPO3\CMS\Core\Utility\File;
163 if (isset($this->f_ext[$type])) {
164 $ik = strtolower($iconkey);
178 if ($this->f_ext[$type][
'allow'] ==
'*') {
181 if ($this->f_ext[$type][
'deny'] ==
'*') {
200 $type = $this->
is_webpath($theDest) ?
'webspace' :
'ftpspace';
201 if (isset($this->f_ext[$type])) {
202 if ((
string)$this->f_ext[$type][
'deny'] ==
'' || $this->f_ext[$type][
'allow'] ==
'*') {
221 $testPathWeb = $this->
slashPath($this->webPath);
222 if ($testPathWeb && $testPath) {
258 if (@is_dir($theDir)) {
286 if ($this->getUniqueNamePrefix) {
288 $origFileInfo[
'file'] = $this->getUniqueNamePrefix . $origFileInfo[
'file'];
289 $origFileInfo[
'filebody'] = $this->getUniqueNamePrefix . $origFileInfo[
'filebody'];
292 $fileInfo = $origFileInfo;
293 $theDestFile = $theDest .
'/' . $fileInfo[
'file'];
295 if (!file_exists($theDestFile) || $dontCheckForUnique) {
300 $theTempFileBody = preg_replace(
'/_[0-9][0-9]$/',
'', $origFileInfo[
'filebody']);
302 $theOrigExt = $origFileInfo[
'realFileext'] ?
'.' . $origFileInfo[
'realFileext'] :
'';
303 for ($a = 1; $a <= $this->maxNumber + 1; $a++) {
304 if ($a <= $this->maxNumber) {
306 $insert =
'_' . sprintf(
'%02d', $a);
309 $insert =
'_' . substr(md5(uniqid(
'',
true)), 0, $this->uniquePrecision);
311 $theTestFile = $theTempFileBody . $insert . $theOrigExt;
312 $theDestFile = $theDest .
'/' . $theTestFile;
314 if (!file_exists($theDestFile)) {
335 foreach ($this->mounts as $k => $val) {
353 if (is_array($this->mounts)) {
354 foreach ($this->mounts as $k => $val) {
379 if (substr($path, -1) !=
'/') {
398 if (
$GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'UTF8filesystem']) {
400 $cleanFileName = preg_replace(
'/[' . self::UNSAFE_FILENAME_CHARACTER_EXPRESSION .
']/u',
'_', trim($fileName));
403 if (!is_object($this->csConvObj)) {
404 if (TYPO3_MODE ==
'FE') {
405 $this->csConvObj =
$GLOBALS[
'TSFE']->csConvObj;
408 $this->csConvObj =
$GLOBALS[
'LANG']->csConvObj;
416 if (TYPO3_MODE ==
'FE') {
417 $charset =
$GLOBALS[
'TSFE']->renderCharset;
425 $fileName = $this->csConvObj->specCharsToASCII($charset, $fileName);
428 $cleanFileName = preg_replace(
'/[' . self::UNSAFE_FILENAME_CHARACTER_EXPRESSION .
'\\xC0-\\xFF]/',
'_', trim($fileName));
431 return rtrim($cleanFileName,
'.');