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.
Fixes #51182.

git-svn-id: https://develop.svn.wordpress.org/trunk@48913 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2020-08-31 17:09:35 +00:00
parent 3309309f6b
commit 390f84b715

View File

@ -206,7 +206,9 @@ class Theme_Installer_Skin extends WP_Upgrader_Skin {
$all_themes = wp_get_themes( array( 'errors' => null ) ); $all_themes = wp_get_themes( array( 'errors' => null ) );
foreach ( $all_themes as $theme ) { 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; continue;
} }