Upgrade/Install: Improve wp_opcache_invalidate() performance.

Changes from using `preg_match()` based `.php` extension checking to using `substr()` in `wp_opcache_invalidate()`.

Props jnylen0, aaroncampbell, SergeyBiryukov, desrosj, mikeschroder.
Fixes #50784.
Built from https://develop.svn.wordpress.org/trunk@48657


git-svn-id: http://core.svn.wordpress.org/trunk@48419 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Mike Schroder 2020-07-28 08:09:05 +00:00
parent c461697c31
commit 8c3d56919e
2 changed files with 2 additions and 2 deletions

View File

@ -2356,7 +2356,7 @@ function wp_opcache_invalidate( $filepath, $force = false ) {
}
// Verify that file to be invalidated has a PHP extension.
if ( ! preg_match( '/\.(?:php)$/i', $filepath ) ) {
if ( '.php' !== strtolower( substr( $filepath, -4 ) ) ) {
return false;
}

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.5-beta4-48656';
$wp_version = '5.5-beta4-48657';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.