From 60facd2741847906b4785388455aa351a031ab16 Mon Sep 17 00:00:00 2001 From: flynsarmy Date: Sat, 26 Sep 2015 18:12:13 +1000 Subject: [PATCH] Use correct folder permissions in ThemeImport/Export --- modules/cms/models/ThemeExport.php | 6 +++--- modules/cms/models/ThemeImport.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/cms/models/ThemeExport.php b/modules/cms/models/ThemeExport.php index dc9247f25..bd6fa5c79 100644 --- a/modules/cms/models/ThemeExport.php +++ b/modules/cms/models/ThemeExport.php @@ -86,10 +86,10 @@ class ThemeExport extends Model $zipName = uniqid('oc'); $zipPath = temp_path().'/'.$zipName; - if (!@mkdir($tempPath)) + if (!File::makeDirectory($tempPath)) throw new ApplicationException('Unable to create directory '.$tempPath); - if (!@mkdir($metaPath = $tempPath . '/meta')) + if (!File::makeDirectory($metaPath = $tempPath . '/meta')) throw new ApplicationException('Unable to create directory '.$metaPath); File::copy($themePath.'/theme.yaml', $tempPath.'/theme.yaml'); @@ -133,7 +133,7 @@ class ThemeExport extends Model $headers = Response::download($zipPath, $outputName)->headers->all(); $result = Response::make(File::get($zipPath), 200, $headers); - @unlink($zipPath); + @File::delete($zipPath); return $result; } diff --git a/modules/cms/models/ThemeImport.php b/modules/cms/models/ThemeImport.php index 5e9fa034f..59e78fe04 100644 --- a/modules/cms/models/ThemeImport.php +++ b/modules/cms/models/ThemeImport.php @@ -101,7 +101,7 @@ class ThemeImport extends Model File::put($zipPath, $file->getContents()); - if (!@mkdir($tempPath)) + if (!File::makeDirectory($tempPath)) throw new ApplicationException('Unable to create directory '.$tempPath); Zip::extract($zipPath, $tempPath);