Commit a43c3ee8 authored by Mike Schroder's avatar Mike Schroder
Browse files

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: https://core.svn.wordpress.org/trunk@48419 1a063a9b-81f0-0310-95a4-ce76da25c4cd
parent de203185
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;
	}

+1 −1
Original line number Diff line number Diff line
@@ -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.