Do not check to see if parents of folders outside of the Destination folder exist within the Archive extractors, unzip_file() will take care of that area. Fixes #13741

git-svn-id: https://develop.svn.wordpress.org/trunk@15156 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dion Hulse 2010-06-07 11:19:51 +00:00
parent 16236db4fa
commit ccbfa3b52b
1 changed files with 4 additions and 0 deletions

View File

@ -606,6 +606,8 @@ function _unzip_file_ziparchive($file, $to, $needed_dirs = array() ) {
// Check the parent folders of the folders all exist within the creation array.
if ( untrailingslashit($to) == $dir ) // Skip over the working directory, We know this exists (or will exist)
continue;
if ( strpos($dir, $to) === false ) // If the directory is not within the working directory, Skip it
continue;
$parent_folder = dirname($dir);
while ( !empty($parent_folder) && untrailingslashit($to) != $parent_folder && !in_array($parent_folder, $needed_dirs) ) {
@ -685,6 +687,8 @@ function _unzip_file_pclzip($file, $to, $needed_dirs = array()) {
// Check the parent folders of the folders all exist within the creation array.
if ( untrailingslashit($to) == $dir ) // Skip over the working directory, We know this exists (or will exist)
continue;
if ( strpos($dir, $to) === false ) // If the directory is not within the working directory, Skip it
continue;
$parent_folder = dirname($dir);
while ( !empty($parent_folder) && untrailingslashit($to) != $parent_folder && !in_array($parent_folder, $needed_dirs) ) {