Commit bb765de725bb3aebdb2fba271663278d54b4fbfb
1 parent
109053e3
(#2760) check that there is no folder before creating one
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@2396 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
6 additions
and
3 deletions
lib/foldermanagement/PhysicalFolderManagement.inc
| @@ -22,9 +22,12 @@ class PhysicalFolderManagement { | @@ -22,9 +22,12 @@ class PhysicalFolderManagement { | ||
| 22 | * | 22 | * |
| 23 | */ | 23 | */ |
| 24 | function createFolder($sPath) { | 24 | function createFolder($sPath) { |
| 25 | - global $default; | ||
| 26 | - | ||
| 27 | - return mkdir($sPath, 0755); | 25 | + // check if a folder with this name exists before creating it |
| 26 | + if (!file_exists($sPath)) { | ||
| 27 | + return mkdir($sPath, 0755); | ||
| 28 | + } else { | ||
| 29 | + return true; | ||
| 30 | + } | ||
| 28 | } | 31 | } |
| 29 | 32 | ||
| 30 | /** | 33 | /** |