diff --git a/src/wp-admin/includes/file.php b/src/wp-admin/includes/file.php index f9f5be10ce..7bb04f8fc3 100644 --- a/src/wp-admin/includes/file.php +++ b/src/wp-admin/includes/file.php @@ -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; }