Make WordPress Core

Changeset 48657


Ignore:
Timestamp:
07/28/2020 08:07:04 AM (4 years ago)
Author:
mikeschroder
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/file.php

    r48632 r48657  
    23572357
    23582358    // Verify that file to be invalidated has a PHP extension.
    2359     if ( ! preg_match( '/\.(?:php)$/i', $filepath ) ) {
     2359    if ( '.php' !== strtolower( substr( $filepath, -4 ) ) ) {
    23602360        return false;
    23612361    }
Note: See TracChangeset for help on using the changeset viewer.