mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-03 16:50:13 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@54712 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -724,11 +724,10 @@ function get_attached_file( $attachment_id, $unfiltered = false ) {
|
||||
$file = get_post_meta( $attachment_id, '_wp_attached_file', true );
|
||||
|
||||
// If the file is relative, prepend upload dir.
|
||||
if ( $file ) {
|
||||
if ( $file && 0 !== strpos( $file, '/' ) && ! preg_match( '|^.:\\\|', $file ) ) {
|
||||
$uploads = wp_get_upload_dir();
|
||||
|
||||
if ( false === $uploads['error'] ) {
|
||||
$file = path_join( $uploads['basedir'], $file );
|
||||
$file = $uploads['basedir'] . "/$file";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user