mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-30 23:30:05 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@48657 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user