Make WordPress Core


Ignore:
Timestamp:
10/28/2022 03:16:29 PM (2 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].
See #56924.

File:
1 edited

Legend:

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

    r54524 r54712  
    725725
    726726    // If the file is relative, prepend upload dir.
    727     if ( $file ) {
     727    if ( $file && 0 !== strpos( $file, '/' ) && ! preg_match( '|^.:\\\|', $file ) ) {
    728728        $uploads = wp_get_upload_dir();
    729 
    730729        if ( false === $uploads['error'] ) {
    731             $file = path_join( $uploads['basedir'], $file );
     730            $file = $uploads['basedir'] . "/$file";
    732731        }
    733732    }
Note: See TracChangeset for help on using the changeset viewer.