WordPress.org

Make WordPress Core

Changeset 42215


Ignore:
Timestamp:
11/21/2017 04:15:24 AM (4 years ago)
Author:
dd32
Message:

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.
Merges [42214] to the 4.9 branch.
Fixes #42628 for 4.9.

Location:
branches/4.9
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.9

  • branches/4.9/src/wp-admin/includes/class-wp-upgrader.php

    r41821 r42215  
    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        }
Note: See TracChangeset for help on using the changeset viewer.