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:
parent
b29101aca0
commit
81c39e949f
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user