[VD] use elFinder::splitFileExtention()

This commit is contained in:
nao-pon
2017-12-08 13:09:37 +09:00
parent 1616170f3b
commit 5632f2595a
3 changed files with 8 additions and 11 deletions
+2 -4
View File
@@ -1049,10 +1049,8 @@ class elFinderVolumeLocalFileSystem extends elFinderVolumeDriver {
// for several files - create new directory
// create unique name for directory
$src = $dir;
$name = basename($path);
if (preg_match('/\.((tar\.(gz|bz|bz2|z|lzo))|cpio\.gz|ps\.gz|xcf\.(gz|bz2)|[a-z0-9]{1,4})$/i', $name, $m)) {
$name = substr($name, 0, strlen($name)-strlen($m[0]));
}
$splits = elFinder::splitFileExtention(basename($path));
$name = $splits[0];
$test = dirname($path).DIRECTORY_SEPARATOR.$name;
if (file_exists($test) || is_link($test)) {
$name = $this->uniqueName(dirname($path), $name, '-', false);