From a6121196939b13480c4aeabd4c7b2e616f3ca83f Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Sat, 18 Oct 2008 19:48:49 +0000 Subject: [PATCH] Recognize windows absolute paths. see #7904 git-svn-id: https://develop.svn.wordpress.org/trunk@9242 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/post.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/wp-includes/post.php b/wp-includes/post.php index 3d3511fa4c..ac7412f215 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -28,9 +28,8 @@ 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 ( 0 !== strpos($file, '/') && ( ($uploads = wp_upload_dir()) && false === $uploads['error'] ) ) + if ( 0 !== strpos($file, '/') && !preg_match('|^.:\\\|', $file) && ( ($uploads = wp_upload_dir()) && false === $uploads['error'] ) ) $file = $uploads['basedir'] . "/$file"; - if ( $unfiltered ) return $file; return apply_filters( 'get_attached_file', $file, $attachment_id );