From 363aea4c96e879fbe9ea41987656c5d45e1eb170 Mon Sep 17 00:00:00 2001 From: Taras Machyshyn Date: Thu, 9 Oct 2014 17:24:48 +0300 Subject: [PATCH] fileManager fixes --- application/Espo/Core/Utils/File/Manager.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/application/Espo/Core/Utils/File/Manager.php b/application/Espo/Core/Utils/File/Manager.php index 64b36e34b4..2dbe3cf034 100644 --- a/application/Espo/Core/Utils/File/Manager.php +++ b/application/Espo/Core/Utils/File/Manager.php @@ -381,7 +381,7 @@ class Manager } } } else { - $fileList = is_file($sourcePath) ? (array) $sourcePath : $this->getFileList($sourcePath, $recursively, '', 'all', true); + $fileList = is_file($sourcePath) ? (array) $sourcePath : $this->getFileList($sourcePath, $recursively, '', 'file', true); } /** Check permission before copying */ @@ -394,8 +394,12 @@ class Manager $destFile = $this->concatPaths(array($destPath, $file)); + $isFileExists = file_exists($destFile); + if ($this->checkCreateFile($destFile) === false) { $permissionDeniedList[] = $destFile; + } else if (!$isFileExists) { + $this->removeFile($destFile); } } /** END */