WordPress.org

Make WordPress Core

Changeset 46400


Ignore:
Timestamp:
10/05/2019 02:15:13 AM (2 months ago)
Author:
SergeyBiryukov
Message:

Filesystem API: Use strict type check in the in_array() call for the $skip_list parameter in copy_dir() and _copy_dir().

This ensures that parent folders with a numeric name are not accidentally skipped when only a subfolder is intended to be skipped.

Props codex-m.
Fixes #46581.

Location:
trunk/src/wp-admin/includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/file.php

    r46399 r46400  
    17061706
    17071707    foreach ( (array) $dirlist as $filename => $fileinfo ) {
    1708         if ( in_array( $filename, $skip_list ) ) {
     1708        if ( in_array( $filename, $skip_list, true ) ) {
    17091709            continue;
    17101710        }
  • trunk/src/wp-admin/includes/update-core.php

    r46278 r46400  
    13131313
    13141314    foreach ( (array) $dirlist as $filename => $fileinfo ) {
    1315         if ( in_array( $filename, $skip_list ) ) {
     1315        if ( in_array( $filename, $skip_list, true ) ) {
    13161316            continue;
    13171317        }
Note: See TracChangeset for help on using the changeset viewer.