Skip to content

Commit 2c1858a

Browse files
committed
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
1 parent 4ec5d65 commit 2c1858a

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/wp-admin/includes/class-wp-upgrader.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,8 @@ protected function flatten_dirlist( $nested_files, $path = '' ) {
342342
if ( ! empty( $details['files'] ) ) {
343343
$children = $this->flatten_dirlist( $details['files'], $path . $name . '/' );
344344

345-
$files = array_merge( $files, $children );
345+
// Merge keeping possible numeric keys, which array_merge() will reindex from 0..n
346+
$files = $files + $children;
346347
}
347348
}
348349

0 commit comments

Comments
 (0)