Skip to content

Commit 8001f36

Browse files
ENGCOM-3069: Fix for removing the dirs while creating a TAR archive #18322
- Merge Pull Request #18322 from haroldclaus/magento2:hotfix/archiveTarRemoveDirsFix-develop-2-3 - Merged commits: 1. f08a19d 2. 39e0ad9
2 parents 8460e4e + 39e0ad9 commit 8001f36

File tree

1 file changed

+5
-8
lines changed
  • lib/internal/Magento/Framework/Archive

1 file changed

+5
-8
lines changed

lib/internal/Magento/Framework/Archive/Tar.php

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
* See COPYING.txt for license details.
55
*/
66

7+
namespace Magento\Framework\Archive;
8+
9+
use Magento\Framework\Archive\Helper\File;
10+
711
/**
812
* Class to work with tar archives
913
*
1014
* @author Magento Core Team <[email protected]>
1115
*/
12-
namespace Magento\Framework\Archive;
13-
14-
use Magento\Framework\Archive\Helper\File;
15-
1616
class Tar extends \Magento\Framework\Archive\AbstractArchive implements \Magento\Framework\Archive\ArchiveInterface
1717
{
1818
/**
@@ -259,10 +259,7 @@ protected function _createTar($skipRoot = false, $finalize = false)
259259
);
260260
}
261261

262-
array_shift($dirFiles);
263-
/* remove './'*/
264-
array_shift($dirFiles);
265-
/* remove '../'*/
262+
$dirFiles = array_diff($dirFiles, ['..', '.']);
266263

267264
foreach ($dirFiles as $item) {
268265
$this->_setCurrentFile($file . $item)->_createTar();

0 commit comments

Comments
 (0)