Make WordPress Core

Ticket #50784: 50784.substr.diff

File 50784.substr.diff, 469 bytes (added by kirasong, 5 years ago)
  • src/wp-admin/includes/file.php

    diff --git src/wp-admin/includes/file.php src/wp-admin/includes/file.php
    index f9f5be10cea..7bb04f8fc3d 100644
    function wp_opcache_invalidate( $filepath, $force = false ) { 
    23562356        }
    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        }
    23622362