diff --git a/kernel/FileUpload.php b/kernel/FileUpload.php index 7a1705b..a61893c 100644 --- a/kernel/FileUpload.php +++ b/kernel/FileUpload.php @@ -36,7 +36,9 @@ class FileUpload $newFileName = md5(time() . $this->fileName) . '.' . $this->fileExtension; if (in_array($this->fileExtension, $this->allowedFileExtensions)) { $this->uploadDir = $uploadDir . mb_substr($newFileName, 0, 2) . '/' . mb_substr($newFileName, 2, 2) . '/'; - mkdir(ROOT_DIR . $this->uploadDir, 0777, true); + $oldMask = umask(0); + mkdir(ROOT_DIR . $this->uploadDir, 0775, true); + umask($oldMask); $uploadFileDir = ROOT_DIR . $this->uploadDir; $this->destPath = $uploadFileDir . $newFileName; $this->uploadFile = $this->uploadDir . $newFileName; @@ -49,7 +51,9 @@ class FileUpload } else { if (in_array($this->fileExtension, $this->allowedFileExtensions)) { $this->uploadDir = $uploadDir; - mkdir(ROOT_DIR . $this->uploadDir, 0777, true); + $oldMask = umask(0); + mkdir(ROOT_DIR . $this->uploadDir, 0775, true); + umask($oldMask); $uploadFileDir = ROOT_DIR . $this->uploadDir; $this->destPath = $uploadFileDir . $this->fileName; $this->uploadFile = $this->uploadDir . $this->fileName; diff --git a/kernel/admin_themes/default/layout/main.php b/kernel/admin_themes/default/layout/main.php index db00106..1574044 100644 --- a/kernel/admin_themes/default/layout/main.php +++ b/kernel/admin_themes/default/layout/main.php @@ -27,7 +27,11 @@