check if folder is not empty (may happen for absolute paths). Thanks paul

git-svn-id: file:///svn/phpbb/trunk@8640 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen 2008-06-09 17:46:41 +00:00
parent e199f55ba2
commit 50f5502cc9

View file

@ -213,6 +213,12 @@ class compress_zip extends compress
// Create and folders and subfolders if they do not exist // Create and folders and subfolders if they do not exist
foreach ($folders as $folder) foreach ($folders as $folder)
{ {
$folder = trim($folder);
if (!$folder)
{
continue;
}
$str = (!empty($str)) ? $str . '/' . $folder : $folder; $str = (!empty($str)) ? $str . '/' . $folder : $folder;
if (!is_dir($str)) if (!is_dir($str))
{ {
@ -236,6 +242,12 @@ class compress_zip extends compress
// Create and folders and subfolders if they do not exist // Create and folders and subfolders if they do not exist
foreach ($folders as $folder) foreach ($folders as $folder)
{ {
$folder = trim($folder);
if (!$folder)
{
continue;
}
$str = (!empty($str)) ? $str . '/' . $folder : $folder; $str = (!empty($str)) ? $str . '/' . $folder : $folder;
if (!is_dir($str)) if (!is_dir($str))
{ {
@ -515,6 +527,12 @@ class compress_tar extends compress
// Create and folders and subfolders if they do not exist // Create and folders and subfolders if they do not exist
foreach ($folders as $folder) foreach ($folders as $folder)
{ {
$folder = trim($folder);
if (!$folder)
{
continue;
}
$str = (!empty($str)) ? $str . '/' . $folder : $folder; $str = (!empty($str)) ? $str . '/' . $folder : $folder;
if (!is_dir($str)) if (!is_dir($str))
{ {
@ -536,6 +554,12 @@ class compress_tar extends compress
// Create and folders and subfolders if they do not exist // Create and folders and subfolders if they do not exist
foreach ($folders as $folder) foreach ($folders as $folder)
{ {
$folder = trim($folder);
if (!$folder)
{
continue;
}
$str = (!empty($str)) ? $str . '/' . $folder : $folder; $str = (!empty($str)) ? $str . '/' . $folder : $folder;
if (!is_dir($str)) if (!is_dir($str))
{ {