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.

Built from https://develop.svn.wordpress.org/trunk@54712


git-svn-id: http://core.svn.wordpress.org/trunk@54264 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
antpb
2022-10-28 15:18:11 +00:00
parent 322445185a
commit 1d4fa825b8
3 changed files with 3 additions and 10 deletions

View File

@@ -2079,7 +2079,6 @@ function wp_mkdir_p( $target ) {
* For example, '/foo/bar', or 'c:\windows'.
*
* @since 2.5.0
* @since 6.1.0 Allows normalized Windows paths (forward slashes).
*
* @param string $path File path.
* @return bool True if path is absolute, false is not absolute.
@@ -2110,11 +2109,6 @@ function path_is_absolute( $path ) {
return true;
}
// Normalized Windows paths for local filesystem and network shares (forward slashes).
if ( preg_match( '#(^[a-zA-Z]+:/|^//[\w!@\#\$%\^\(\)\-\'{}\.~]{1,15})#', $path ) ) {
return true;
}
// A path starting with / or \ is absolute; anything else is relative.
return ( '/' === $path[0] || '\\' === $path[0] );
}