Ticket #36455: 36455.8.diff
| File 36455.8.diff, 2.2 KB (added by , 6 years ago) |
|---|
-
wp-admin/includes/file.php
1728 1728 $from = trailingslashit( $from ); 1729 1729 $to = trailingslashit( $to ); 1730 1730 1731 /** 1732 * Filters whether to invalidate files in the PHP opcache 1733 * after it is written during an upgrade. 1734 * 1735 * @since 5.4.0 1736 * 1737 * @param bool $invalidate Whether to invalidate. Default true. 1738 */ 1739 $opcache_invalidate_allowed = function_exists( 'opcache_invalidate' ) && apply_filters('wp_opcache_invalidate_allowed', true); 1740 1731 1741 foreach ( (array) $dirlist as $filename => $fileinfo ) { 1732 1742 if ( in_array( $filename, $skip_list, true ) ) { 1733 1743 continue; 1734 1744 } 1735 1745 1746 if ($opcache_invalidate_allowed && in_array( pathinfo( $filename, PATHINFO_EXTENSION ), array( 'php', 'phtml' ), true ) ) { 1747 opcache_invalidate( $to . $filename ); 1748 } 1749 1736 1750 if ( 'f' === $fileinfo['type'] ) { 1737 1751 if ( ! $wp_filesystem->copy( $from . $filename, $to . $filename, true, FS_CHMOD_FILE ) ) { 1738 1752 // If copy failed, chmod file to 0644 and try again. -
wp-admin/includes/update-core.php
1339 1339 $from = trailingslashit( $from ); 1340 1340 $to = trailingslashit( $to ); 1341 1341 1342 /** This filter is documented in wp-admin/includes/file.php */ 1343 $opcache_invalidate_allowed = function_exists( 'opcache_invalidate' ) && apply_filters('wp_opcache_invalidate_allowed', true); 1344 1342 1345 foreach ( (array) $dirlist as $filename => $fileinfo ) { 1343 1346 if ( in_array( $filename, $skip_list, true ) ) { 1344 1347 continue; 1345 1348 } 1346 1349 1350 if ($opcache_invalidate_allowed && in_array( pathinfo( $filename, PATHINFO_EXTENSION ), array( 'php', 'phtml' ), true ) ) { 1351 opcache_invalidate( $to . $filename ); 1352 } 1353 1347 1354 if ( 'f' === $fileinfo['type'] ) { 1348 1355 if ( ! $wp_filesystem->copy( $from . $filename, $to . $filename, true, FS_CHMOD_FILE ) ) { 1349 1356 // If copy failed, chmod file to 0644 and try again.