Filesystem API: Don't add `'.'` to the list of directories which need to be checked/created when extracting a file.
Prevents a PHP warning by `WP_Filesystem_Direct::mkdir()` when installing a language pack which doesn't have subdirectories. Props tfrommen. Fixes #36570. Built from https://develop.svn.wordpress.org/trunk@37421 git-svn-id: http://core.svn.wordpress.org/trunk@37387 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
a726a9f51f
commit
546b031453
|
@ -643,10 +643,13 @@ function _unzip_file_ziparchive($file, $to, $needed_dirs = array() ) {
|
|||
|
||||
$uncompressed_size += $info['size'];
|
||||
|
||||
if ( '/' == substr($info['name'], -1) ) // directory
|
||||
$needed_dirs[] = $to . untrailingslashit($info['name']);
|
||||
else
|
||||
$needed_dirs[] = $to . untrailingslashit(dirname($info['name']));
|
||||
if ( '/' === substr( $info['name'], -1 ) ) {
|
||||
// Directory.
|
||||
$needed_dirs[] = $to . untrailingslashit( $info['name'] );
|
||||
} elseif ( '.' !== $dirname = dirname( $info['name'] ) ) {
|
||||
// Path to a file.
|
||||
$needed_dirs[] = $to . untrailingslashit( $dirname );
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.6-alpha-37419';
|
||||
$wp_version = '4.6-alpha-37421';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue