diff --git a/wp-includes/post.php b/wp-includes/post.php index b29d0d2b69..c89c5527fd 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -1259,7 +1259,7 @@ function wp_insert_attachment($object, $file = false, $post_parent = 0) { wp_set_post_categories($post_ID, $post_category); if ( $file ) - add_post_meta($post_ID, '_wp_attached_file', $file ); + add_post_meta($post_ID, '_wp_attached_file', quotemeta( $file ) ); clean_post_cache($post_ID);