Make WordPress Core


Ignore:
Timestamp:
10/28/2022 03:28:59 PM (4 years ago)
Author:
antpb
Message:

Media: Reverts get_attached_file() changes for normalized Windows paths.

Based on feedback from network storage configurations there was a noticed slowdown due to the usage of the path_join() function. This needs more time to find a workaround.

Follow-up to [53934].
Props mreishus, SergeyBiryukov, desrosj, mikeschroder.
Reverts [53934] in the 6.1 Branch.
See #56924.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/6.1/src/wp-includes/functions.php

    r54522 r54713  
    20802080 *
    20812081 * @since 2.5.0
    2082  * @since 6.1.0 Allows normalized Windows paths (forward slashes).
    20832082 *
    20842083 * @param string $path File path.
    … …  
    21082107        // Windows allows absolute paths like this.
    21092108        if ( preg_match( '#^[a-zA-Z]:\\\\#', $path ) ) {
    2110                 return true;
    2111         }
    2112 
    2113         // Normalized Windows paths for local filesystem and network shares (forward slashes).
    2114         if ( preg_match( '#(^[a-zA-Z]+:/|^//[\w!@\#\$%\^\(\)\-\'{}\.~]{1,15})#', $path ) ) {
    21152109                return true;
    21162110        }
Note: See TracChangeset for help on using the changeset viewer.