From 546b0314532550a1fccb5dc44098f5c12285a468 Mon Sep 17 00:00:00 2001 From: Dominik Schilling Date: Thu, 12 May 2016 12:40:28 +0000 Subject: [PATCH] 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 --- wp-admin/includes/file.php | 11 +++++++---- wp-includes/version.php | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/wp-admin/includes/file.php b/wp-admin/includes/file.php index e527b2eb97..5abb4cfba5 100644 --- a/wp-admin/includes/file.php +++ b/wp-admin/includes/file.php @@ -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 ); + } } /* diff --git a/wp-includes/version.php b/wp-includes/version.php index 5a29078b40..a8b95baf3b 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -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.