From e46f4cb50550bd00ad9dfd64090884c764877737 Mon Sep 17 00:00:00 2001 From: "Paul S. Owen" Date: Wed, 13 Aug 2003 16:43:58 +0000 Subject: [PATCH] Seems some compression applications don't bother with little things like standards ... git-svn-id: file:///svn/phpbb/trunk@4399 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_compress.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/phpBB/includes/functions_compress.php b/phpBB/includes/functions_compress.php index 9a70bd9fc0..5aabc1b592 100644 --- a/phpBB/includes/functions_compress.php +++ b/phpBB/includes/functions_compress.php @@ -417,12 +417,24 @@ class compress_tar extends compress { $mkdir_ary[] = "$dst$filename"; } + else if (dirname($filename) != '.') + { + $mkdir_alt_ary[] = $dst . dirname($filename); + } } } + $mkdir_alt_ary = array_unique($mkdir_alt_ary); + // Create the directory structure - if (is_array($mkdir_ary)) + if (sizeof($mkdir_ary) || sizeof($mkdir_alt_ary)) { + if (!sizeof($mkdir_ary) && sizeof($mkdir_alt_ary)) + { + $mkdir_ary = $mkdir_alt_ary; + unset($mkdir_alt_ary); + } + sort($mkdir_ary); foreach ($mkdir_ary as $dir) { @@ -460,7 +472,7 @@ class compress_tar extends compress $tmp = unpack("Atype", substr($buffer, 156, 1)); $filetype = (int) trim($tmp['type']); - if ($filetype != 5) + if ($filetype == 0 || $filetype == "\0") { $tmp = unpack("A12size", substr($buffer, 124, 12)); $filesize = octdec((int) trim($tmp['size']));