aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_compress.php
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes/functions_compress.php')
-rw-r--r--phpBB/includes/functions_compress.php20
1 files changed, 20 insertions, 0 deletions
diff --git a/phpBB/includes/functions_compress.php b/phpBB/includes/functions_compress.php
index 2f3db3d343..700303fd7d 100644
--- a/phpBB/includes/functions_compress.php
+++ b/phpBB/includes/functions_compress.php
@@ -200,6 +200,26 @@ class compress_zip extends compress
// This is a directory, we are not writting files
continue;
}
+ else
+ {
+ // Some archivers are punks, they don't don't include folders in their archives!
+ $str = '';
+ $folders = explode('/', pathinfo($target_filename, PATHINFO_DIRNAME));
+
+ // Create and folders and subfolders if they do not exist
+ foreach ($folders as $folder)
+ {
+ $str = (!empty($str)) ? $str . '/' . $folder : $folder;
+ if (!is_dir($str))
+ {
+ if (!@mkdir($str, 0777))
+ {
+ trigger_error("Could not create directory $folder");
+ }
+ @chmod($str, 0777);
+ }
+ }
+ }
if (!$data['uc_size'])
{