diff --git a/src/wp-admin/includes/file.php b/src/wp-admin/includes/file.php
index edfdef5756..01cec77b7b 100644
|
a
|
b
|
function _unzip_file_pclzip( $file, $to, $needed_dirs = array() ) { |
| 1701 | 1701 | * Copies a directory from one location to another via the WordPress Filesystem |
| 1702 | 1702 | * Abstraction. |
| 1703 | 1703 | * |
| 1704 | | * Assumes that WP_Filesystem() has already been called and setup. |
| | 1704 | * Assumes that WP_Filesystem() has already been called and set up. |
| 1705 | 1705 | * |
| 1706 | 1706 | * @since 2.5.0 |
| 1707 | 1707 | * |
| … |
… |
function copy_dir( $from, $to, $skip_list = array() ) { |
| 1733 | 1733 | return new WP_Error( 'copy_failed_copy_dir', __( 'Could not copy file.' ), $to . $filename ); |
| 1734 | 1734 | } |
| 1735 | 1735 | } |
| | 1736 | if ( |
| | 1737 | '.php' === strtolower( substr( $filename, -4 ) ) && |
| | 1738 | function_exists( 'opcache_invalidate' ) && |
| | 1739 | /** |
| | 1740 | * Filters whether to invalidate a file in the PHP opcache |
| | 1741 | * after it is written during an upgrade. |
| | 1742 | * |
| | 1743 | * @since 5.4.0 |
| | 1744 | * |
| | 1745 | * @param bool $invalidate Whether to invalidate. Default true. |
| | 1746 | * @param string $filename The PHP filename that was just copied. |
| | 1747 | */ |
| | 1748 | apply_filters( 'wp_opcache_invalidate_file', true, $to . $filename ) |
| | 1749 | ) { |
| | 1750 | opcache_invalidate( $to . $filename ); |
| | 1751 | } |
| 1736 | 1752 | } elseif ( 'd' == $fileinfo['type'] ) { |
| 1737 | 1753 | if ( ! $wp_filesystem->is_dir( $to . $filename ) ) { |
| 1738 | 1754 | if ( ! $wp_filesystem->mkdir( $to . $filename, FS_CHMOD_DIR ) ) { |
diff --git a/src/wp-admin/includes/update-core.php b/src/wp-admin/includes/update-core.php
index 9dbe8bead1..fd69c38447 100644
|
a
|
b
|
function update_core( $from, $to ) { |
| 1307 | 1307 | } |
| 1308 | 1308 | |
| 1309 | 1309 | /** |
| 1310 | | * Copies a directory from one location to another via the WordPress Filesystem Abstraction. |
| 1311 | | * Assumes that WP_Filesystem() has already been called and setup. |
| | 1310 | * Copies a directory from one location to another via the WordPress Filesystem |
| | 1311 | * Abstraction. |
| 1312 | 1312 | * |
| 1313 | | * This is a temporary function for the 3.1 -> 3.2 upgrade, as well as for those upgrading to |
| 1314 | | * 3.7+ |
| | 1313 | * Assumes that WP_Filesystem() has already been called and set up. |
| | 1314 | * |
| | 1315 | * This is a standalone copy of the `copy_dir()` function that is used to |
| | 1316 | * upgrade the core files. It is placed here so that the version of this |
| | 1317 | * function from the *new* WordPress version will be called. |
| 1315 | 1318 | * |
| 1316 | 1319 | * @ignore |
| 1317 | 1320 | * @since 3.2.0 |
| … |
… |
function _copy_dir( $from, $to, $skip_list = array() ) { |
| 1346 | 1349 | return new WP_Error( 'copy_failed__copy_dir', __( 'Could not copy file.' ), $to . $filename ); |
| 1347 | 1350 | } |
| 1348 | 1351 | } |
| | 1352 | if ( |
| | 1353 | '.php' === strtolower( substr( $filename, -4 ) ) && |
| | 1354 | function_exists( 'opcache_invalidate' ) && |
| | 1355 | /** This filter is documented in wp-admin/includes/file.php */ |
| | 1356 | apply_filters( 'wp_opcache_invalidate_file', true, $to . $filename ) |
| | 1357 | ) { |
| | 1358 | opcache_invalidate( $to . $filename ); |
| | 1359 | } |
| 1349 | 1360 | } elseif ( 'd' == $fileinfo['type'] ) { |
| 1350 | 1361 | if ( ! $wp_filesystem->is_dir( $to . $filename ) ) { |
| 1351 | 1362 | if ( ! $wp_filesystem->mkdir( $to . $filename, FS_CHMOD_DIR ) ) { |