From 3dc53770b7799d9911f47804ac705084b50441f2 Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Mon, 23 Mar 2015 04:40:27 +0000 Subject: [PATCH] Upgrader: When creating a temporary working directory, strip off `.tmp` as well as `.zip` incase we end up using that directory as the items main directory. Fixes #30945 Built from https://develop.svn.wordpress.org/trunk@31863 git-svn-id: http://core.svn.wordpress.org/trunk@31842 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/class-wp-upgrader.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-admin/includes/class-wp-upgrader.php b/wp-admin/includes/class-wp-upgrader.php index ac75c0e026..89b51bb607 100644 --- a/wp-admin/includes/class-wp-upgrader.php +++ b/wp-admin/includes/class-wp-upgrader.php @@ -263,8 +263,8 @@ class WP_Upgrader { $wp_filesystem->delete($upgrade_folder . $file['name'], true); } - //We need a working directory - $working_dir = $upgrade_folder . basename($package, '.zip'); + // We need a working directory - Strip off any .tmp or .zip suffixes + $working_dir = $upgrade_folder . basename( basename( $package, '.tmp' ), '.zip' ); // Clean up working directory if ( $wp_filesystem->is_dir($working_dir) )