diff --git a/wp-includes/functions.php b/wp-includes/functions.php index c303f0d4a6..563c4d78b8 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -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] ); } diff --git a/wp-includes/post.php b/wp-includes/post.php index a67d7a79a1..d7e7bfec99 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -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"; } } diff --git a/wp-includes/version.php b/wp-includes/version.php index 54acffcf04..076c45a28d 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.1-RC4-54709'; +$wp_version = '6.1-RC4-54713'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.