From 5e7d0e50bf70bbd4d45714a2426fc520db1881ee Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers Date: Mon, 31 Aug 2020 18:28:54 +0000 Subject: [PATCH] Themes: Normalize the installed theme path in `Theme_Installer_Skin::do_overwrite()` before comparing with the uploaded theme. This ensures that the data for the currently installed theme is picked up properly when uploading a theme update on Windows. Follow-up to [48390]. Props bobbingwide, wpamitkumar, mukesh27. Merges [48913] to the 5.5 branch. Fixes #51182. git-svn-id: https://develop.svn.wordpress.org/branches/5.5@48919 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/class-theme-installer-skin.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/wp-admin/includes/class-theme-installer-skin.php b/src/wp-admin/includes/class-theme-installer-skin.php index 16e99332a6..c6d0900abe 100644 --- a/src/wp-admin/includes/class-theme-installer-skin.php +++ b/src/wp-admin/includes/class-theme-installer-skin.php @@ -206,7 +206,9 @@ class Theme_Installer_Skin extends WP_Upgrader_Skin { $all_themes = wp_get_themes( array( 'errors' => null ) ); foreach ( $all_themes as $theme ) { - if ( rtrim( $theme->get_stylesheet_directory(), '/' ) !== $folder ) { + $stylesheet_dir = wp_normalize_path( $theme->get_stylesheet_directory() ); + + if ( rtrim( $stylesheet_dir, '/' ) !== $folder ) { continue; }