aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_compress.php
diff options
context:
space:
mode:
authorDavid M <davidmj@users.sourceforge.net>2006-04-15 18:00:34 +0000
committerDavid M <davidmj@users.sourceforge.net>2006-04-15 18:00:34 +0000
commitea71c3046de2ceb9427dab80755bee0db03938d5 (patch)
treea2ba12add55b981ade3c1ee44608a1bd75cca5d3 /phpBB/includes/functions_compress.php
parent164b55b394852d6e74a4faa987e8891507f22b51 (diff)
downloadforums-ea71c3046de2ceb9427dab80755bee0db03938d5.tar
forums-ea71c3046de2ceb9427dab80755bee0db03938d5.tar.gz
forums-ea71c3046de2ceb9427dab80755bee0db03938d5.tar.bz2
forums-ea71c3046de2ceb9427dab80755bee0db03938d5.tar.xz
forums-ea71c3046de2ceb9427dab80755bee0db03938d5.zip
- Some archivers are worthless in this world
git-svn-id: file:///svn/phpbb/trunk@5786 89ea8834-ac86-4346-8a33-228a782c2dd0
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'])
{