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. git-svn-id: https://develop.svn.wordpress.org/trunk@46400 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
ef942c65bb
commit
e99e14570e
|
@ -1705,7 +1705,7 @@ function copy_dir( $from, $to, $skip_list = array() ) {
|
||||||
$to = trailingslashit( $to );
|
$to = trailingslashit( $to );
|
||||||
|
|
||||||
foreach ( (array) $dirlist as $filename => $fileinfo ) {
|
foreach ( (array) $dirlist as $filename => $fileinfo ) {
|
||||||
if ( in_array( $filename, $skip_list ) ) {
|
if ( in_array( $filename, $skip_list, true ) ) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1312,7 +1312,7 @@ function _copy_dir( $from, $to, $skip_list = array() ) {
|
||||||
$to = trailingslashit( $to );
|
$to = trailingslashit( $to );
|
||||||
|
|
||||||
foreach ( (array) $dirlist as $filename => $fileinfo ) {
|
foreach ( (array) $dirlist as $filename => $fileinfo ) {
|
||||||
if ( in_array( $filename, $skip_list ) ) {
|
if ( in_array( $filename, $skip_list, true ) ) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue