Opened 5 years ago
Closed 5 years ago
#51182 closed defect (bug) (fixed)
Theme_Installer_skin::do_overwrite does not work on a Windows server
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 5.5.1 | Priority: | normal |
| Severity: | normal | Version: | 5.5 |
| Component: | Upgrade/Install | Keywords: | has-patch commit dev-reviewed fixed-major |
| Focuses: | Cc: |
Description
In my local Windows development environment I tried the new logic to upload plugin and theme .zip files. It worked for plugins but not for themes.
I traced through the code and determined that $current_theme_data was never being set because this loop assumes the character separator is always '/'.
foreach ( $all_themes as $theme ) {
if ( rtrim( $theme->get_stylesheet_directory(), '/' ) !== $folder ) {
continue;
}
$current_theme_data = $theme;
}
In my windows environment
$theme->get_stylesheet_directory() returns, for example
C:\apache\htdocs\cwiccer/wp-content/themes/twentyfifteen
whereas the value of $folder was
C:/apache/htdocs/cwiccer/wp-content/themes/twentyfifteen
Since $current_theme_data is not set the option to replace the theme is not displayed.
Attachments (2)
Change History (11)
#2
@
5 years ago
- Milestone changed from Awaiting Review to 5.5.1
- Owner set to SergeyBiryukov
- Status changed from new to reviewing
Thanks for the patch! Just noting this should probably use wp_normalize_path() instead.
Note: See
TracTickets for help on using
tickets.
This change resolves the problem.
foreach ( $all_themes as $theme ) { $stylesheet_dir = $theme->get_stylesheet_directory(); $stylesheet_dir = str_replace( '\\', '/', $stylesheet_dir); if ( rtrim( $stylesheet_dir, '/' ) !== $folder ) { continue; } $current_theme_data = $theme; }