From b44e25068b0d6d34e140c5ebba25469bebf5345a Mon Sep 17 00:00:00 2001 From: Shreya Shrivastava Date: Wed, 13 May 2026 14:14:43 +0530 Subject: [PATCH] fix: normalize path separators in update_attached_file() to prevent backslashes being stripped on Windows --- src/wp-includes/post.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-includes/post.php b/src/wp-includes/post.php index 005ccadd62e34..e5bed8022851f 100644 --- a/src/wp-includes/post.php +++ b/src/wp-includes/post.php @@ -897,7 +897,7 @@ function update_attached_file( $attachment_id, $file ) { */ $file = apply_filters( 'update_attached_file', $file, $attachment_id ); - $file = _wp_relative_upload_path( $file ); + $file = wp_normalize_path( _wp_relative_upload_path( $file ) ); if ( $file ) { return update_post_meta( $attachment_id, '_wp_attached_file', $file ); } else {