From 2c1858a8c3f6e6d8dfe1efe57cfca4b658094b41 Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Tue, 21 Nov 2017 04:14:33 +0000 Subject: [PATCH] Upgrade: Fix updating plugins which include a numeric file/folder names. The fix in [41821] caused numeric folder names to be reindexed to 0..n when in the root directory (for example, `my-plugin/24/`). Props edo888. See #41524. Fixes #42628 for trunk. git-svn-id: https://develop.svn.wordpress.org/trunk@42214 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/class-wp-upgrader.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/wp-admin/includes/class-wp-upgrader.php b/src/wp-admin/includes/class-wp-upgrader.php index fd70ba469e..71591d60a3 100644 --- a/src/wp-admin/includes/class-wp-upgrader.php +++ b/src/wp-admin/includes/class-wp-upgrader.php @@ -342,7 +342,8 @@ class WP_Upgrader { if ( ! empty( $details['files'] ) ) { $children = $this->flatten_dirlist( $details['files'], $path . $name . '/' ); - $files = array_merge( $files, $children ); + // Merge keeping possible numeric keys, which array_merge() will reindex from 0..n + $files = $files + $children; } }