Bug #14859
closed
Deleting directories ending in a dot in fileadmin-module impossible
Added by Dominic Brander over 19 years ago.
Updated almost 16 years ago.
Description
test/foo.foo = foo.foo can be deleted
test/.foo = .foo can be deleted
test/foo. = .foo can NOT be deleted
the last case should be checked when creating new directories.
I checked this on 3.7 and 3.8 on different Linux-platforms.
(issue imported from #M1280)
Files
Error message:
2: Target seemed not to be a directory! (Shouldn't happen here!)
From class.t3lib_basicfilefunc.php:
/**
* Removes all dots, slashes and spaces after a path...
*
* @param string Input string
* @return string Output string
/
function cleanDirectoryName($theDir) {
return ereg_replace('[\/\. ]$','',$this->rmDoubleSlash($theDir));
}
Not sure why a dot is being removed from the end of a directory. But a solution would simply be to remove the "\." from the regexp.
This is still an issue with 4.0.0. I second not removing the dot, it doesn't do any harm and after all it is allowed when creating a folder.
Once you created it, neither deleting nor renaming are possible, though... sop you're stuck unless you have direct access to the machine or work around the issues differently.
Attached a patch and sent it to core list.
Attached updated version. This bug only affects systems with
GLOBALS['TYPO3_CONF_VARS']['BE']['forceCharset'] == 'utf-8' && $GLOBALS['TYPO3_CONF_VARS']['SYS']['UTF8filesystem']
The patch moves deletion of trailing dots to the beginning of cleanFileName (b/c in utf-8 environments this code line would never be executed).
Won't fix.
Nevertheless, with 0010313 fileadmin-module will no longer be able to create such directories.
Also available in: Atom
PDF