Skip to content

Commit

Permalink
Drop zip file hack for php < 5.2.8
Browse files Browse the repository at this point in the history
  • Loading branch information
glensc committed Feb 5, 2021
1 parent 66bd745 commit 0e79ddb
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions packages/zend-filter/library/Zend/Filter/Compress/Zip.php
Original file line number Diff line number Diff line change
Expand Up @@ -237,24 +237,6 @@ public function decompress($content)
throw new Zend_Filter_Exception($this->_errorString($res));
}

if (version_compare(PHP_VERSION, '5.2.8', '<')) {
for ($i = 0; $i < $zip->numFiles; $i++) {
$statIndex = $zip->statIndex($i);
$currName = $statIndex['name'];
if (($currName[0] == '/') ||
(strpos($currName, '..') === 0) ||
(strpos($currName, './..') === 0)
)
{
// require_once 'Zend/Filter/Exception.php';
throw new Zend_Filter_Exception('Upward directory traversal was detected inside ' . $archive
. ' please use PHP 5.2.8 or greater to take advantage of path resolution features of '
. 'the zip extension in this decompress() method.'
);
}
}
}

$res = @$zip->extractTo($target);
if ($res !== true) {
// require_once 'Zend/Filter/Exception.php';
Expand Down

0 comments on commit 0e79ddb

Please sign in to comment.