Opened 6 years ago
Closed 6 years ago
#51182 closed defect (bug) (fixed)
Theme_Installer_skin::do_overwrite does not work on a Windows server
| Reported by: | bobbingwide | Owned by: | SergeyBiryukov |
|---|---|---|---|
| Priority: | normal | Milestone: | 5.5.1 |
| Component: | Upgrade/Install | Version: | 5.5 |
| Severity: | normal | Keywords: | has-patch commit dev-reviewed fixed-major |
| Cc: | Focuses: |
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
@
6 years ago
- Milestone Awaiting Review → 5.5.1
- Owner set to
- Status new → reviewing
Thanks for the patch! Just noting this should probably use wp_normalize_path() instead.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
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; }