Skip to content

Commit f08a19d

Browse files
committed
Fix for removing the dirs while creating a TAR archive
The bug caused issues during the export of analytics data from advanced reporting. The scandir has parameter were the sort can be placed, but using UNSORTED gives you unwanted lists of files/dirs. Therefor deleting the first 2 via array_shift, is not a proper way of dealing with this Signed-off-by: Harold Claus <[email protected]>
1 parent 4b0750c commit f08a19d

File tree

1 file changed

+1
-4
lines changed
  • lib/internal/Magento/Framework/Archive

1 file changed

+1
-4
lines changed

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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)