172 $theuser = getmyuid();
174 $info[
'tstamp'] = @filemtime($wholePath);
175 $info[
'size'] = @filesize($wholePath);
176 $info[
'type'] = @filetype($wholePath);
177 $info[
'owner'] = @fileowner($wholePath);
178 $info[
'perms'] = @fileperms($wholePath);
179 $info[
'writable'] = !@is_writable($wholePath);
180 $info[
'readable'] = !@is_readable($wholePath);
194 if (isset($this->f_ext[$type])) {
195 $ik = strtolower($iconkey);
209 if ($this->f_ext[$type][
'allow'] ==
'*') {
212 if ($this->f_ext[$type][
'deny'] ==
'*') {
230 $type = $this->
is_webpath($theDest) ?
'webspace' :
'ftpspace';
231 if (isset($this->f_ext[$type])) {
232 if ((
string) $this->f_ext[$type][
'deny'] ==
'' || $this->f_ext[$type][
'allow'] ==
'*') {
250 $testPathWeb = $this->
slashPath($this->webPath);
251 if ($testPathWeb && $testPath) {
299 if (@is_dir($theDir)) {
333 public function getUniqueName($theFile, $theDest, $dontCheckForUnique = 0) {
340 if ($this->getUniqueNamePrefix) {
342 $origFileInfo[
'file'] = $this->getUniqueNamePrefix . $origFileInfo[
'file'];
343 $origFileInfo[
'filebody'] = $this->getUniqueNamePrefix . $origFileInfo[
'filebody'];
346 $fileInfo = $origFileInfo;
347 $theDestFile = $theDest .
'/' . $fileInfo[
'file'];
349 if (!file_exists($theDestFile) || $dontCheckForUnique) {
354 $theTempFileBody = preg_replace(
'/_[0-9][0-9]$/',
'', $origFileInfo[
'filebody']);
356 $theOrigExt = $origFileInfo[
'realFileext'] ?
'.' . $origFileInfo[
'realFileext'] :
'';
357 for ($a = 1; $a <= $this->maxNumber + 1; $a++) {
358 if ($a <= $this->maxNumber) {
360 $insert =
'_' . sprintf(
'%02d', $a);
363 $insert =
'_' . substr(md5(uniqid(
'', TRUE)), 0, $this->uniquePrecision);
365 $theTestFile = $theTempFileBody . $insert . $theOrigExt;
366 $theDestFile = $theDest .
'/' . $theTestFile;
368 if (!file_exists($theDestFile)) {
388 foreach ($this->mounts as $k => $val) {
405 if (is_array($this->mounts)) {
406 foreach ($this->mounts as $k => $val) {
428 $name .=
'[' . $this->mounts[$k][
'name'] .
']: ';
429 $name .= substr($thePath, strlen($this->mounts[$k][
'path']));
444 if ($this->tempFN && is_array($this->mounts)) {
445 foreach ($this->mounts as $k => $val) {
447 if (@is_dir($tDir)) {
480 return str_replace(
'//',
'/', $string);
494 if (substr($path, -1) !=
'/') {
512 if (
$GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'UTF8filesystem']) {
514 $cleanFileName = preg_replace(
'/[' . self::UNSAFE_FILENAME_CHARACTER_EXPRESSION .
']/u',
'_', trim($fileName));
517 if (!is_object($this->csConvObj)) {
519 $this->csConvObj =
$GLOBALS[
'TSFE']->csConvObj;
520 } elseif (is_object(
$GLOBALS[
'LANG'])) {
522 $this->csConvObj =
$GLOBALS[
'LANG']->csConvObj;
531 $charset =
$GLOBALS[
'TSFE']->renderCharset;
539 $fileName = $this->csConvObj->specCharsToASCII($charset, $fileName);
542 $cleanFileName = preg_replace(
'/[' . self::UNSAFE_FILENAME_CHARACTER_EXPRESSION .
'\\xC0-\\xFF]/',
'_', trim($fileName));
545 return preg_replace(
'/\\.*$/',
'', $cleanFileName);
static uniqueList($in_list, $secondParameter=NULL)
static getCanonicalPath($path)
static isFirstPartOfStr($str, $partStr)
static validPathStr($theFile)
cleanDirectoryName($theDir)
cleanFileName($fileName, $charset='')
static getIndpEnv($getEnvName)
checkPathAgainstMounts($thePath)
getUniqueName($theFile, $theDest, $dontCheckForUnique=0)
static logDeprecatedFunction()
static makeInstance($className)
const UNSAFE_FILENAME_CHARACTER_EXPRESSION
static verifyFilenameAgainstDenyPattern($filename)
checkIfFullAccess($theDest)
static split_fileref($fileNameWithPath)
checkFileNameLen($fileName)
getTotalFileInfo($wholePath)
is_allowed($iconkey, $type)
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]
static inList($list, $item)
checkIfAllowed($ext, $theDest, $filename='')