[ticket/7296] Exporting styles to tar creates corrupted archives.

Add the folders to the archive before putting the files inside, seems to break
the tar-archives.

PHPBB3-7296
This commit is contained in:
Joas Schilling 2010-08-22 11:16:19 -04:00
parent 25c579c00d
commit 3cbcff56b2
2 changed files with 6 additions and 5 deletions

View file

@ -2040,23 +2040,18 @@ parse_css_file = {PARSE_CSS_FILE}
{ {
case 'tar': case 'tar':
$ext = '.tar'; $ext = '.tar';
$mimetype = 'x-tar';
$compress = 'compress_tar';
break; break;
case 'zip': case 'zip':
$ext = '.zip'; $ext = '.zip';
$mimetype = 'zip';
break; break;
case 'tar.gz': case 'tar.gz':
$ext = '.tar.gz'; $ext = '.tar.gz';
$mimetype = 'x-gzip';
break; break;
case 'tar.bz2': case 'tar.bz2':
$ext = '.tar.bz2'; $ext = '.tar.bz2';
$mimetype = 'x-bzip2';
break; break;
default: default:

View file

@ -53,13 +53,18 @@ class compress
$filelist = filelist("$phpbb_root_path$src", '', '*'); $filelist = filelist("$phpbb_root_path$src", '', '*');
krsort($filelist); krsort($filelist);
/**
* Commented out, as adding the folders produces corrupted archives
if ($src_path) if ($src_path)
{ {
$this->data($src_path, '', true, stat("$phpbb_root_path$src")); $this->data($src_path, '', true, stat("$phpbb_root_path$src"));
} }
*/
foreach ($filelist as $path => $file_ary) foreach ($filelist as $path => $file_ary)
{ {
/**
* Commented out, as adding the folders produces corrupted archives
if ($path) if ($path)
{ {
// Same as for src_path // Same as for src_path
@ -68,6 +73,7 @@ class compress
$this->data("$src_path$path", '', true, stat("$phpbb_root_path$src$path")); $this->data("$src_path$path", '', true, stat("$phpbb_root_path$src$path"));
} }
*/
foreach ($file_ary as $file) foreach ($file_ary as $file)
{ {