diff --git a/wp-admin/includes/class-wp-ms-themes-list-table.php b/wp-admin/includes/class-wp-ms-themes-list-table.php index c73bc97a44..65e9515cc1 100644 --- a/wp-admin/includes/class-wp-ms-themes-list-table.php +++ b/wp-admin/includes/class-wp-ms-themes-list-table.php @@ -277,27 +277,28 @@ class WP_MS_Themes_List_Table extends WP_List_Table { 'delete' => '' ); - $theme_key = $theme->get_stylesheet(); + $stylesheet = $theme->get_stylesheet(); + $theme_key = urlencode( $stylesheet ); if ( ! $allowed ) { if ( ! $theme->errors() ) - $actions['enable'] = '' . ( $this->is_site_themes ? __( 'Enable' ) : __( 'Network Enable' ) ) . ''; + $actions['enable'] = '' . ( $this->is_site_themes ? __( 'Enable' ) : __( 'Network Enable' ) ) . ''; } else { - $actions['disable'] = '' . ( $this->is_site_themes ? __( 'Disable' ) : __( 'Network Disable' ) ) . ''; + $actions['disable'] = '' . ( $this->is_site_themes ? __( 'Disable' ) : __( 'Network Disable' ) ) . ''; } if ( current_user_can('edit_themes') ) - $actions['edit'] = '' . __('Edit') . ''; + $actions['edit'] = '' . __('Edit') . ''; - if ( ! $allowed && current_user_can( 'delete_themes' ) && ! $this->is_site_themes && $theme_key != get_option( 'stylesheet' ) && $theme_key != get_option( 'template' ) ) + if ( ! $allowed && current_user_can( 'delete_themes' ) && ! $this->is_site_themes && $stylesheet != get_option( 'stylesheet' ) && $stylesheet != get_option( 'template' ) ) $actions['delete'] = '' . __( 'Delete' ) . ''; - $actions = apply_filters( 'theme_action_links', array_filter( $actions ), $theme_key, $theme, $context ); - $actions = apply_filters( "theme_action_links_$theme_key", $actions, $theme_key, $theme, $context ); + $actions = apply_filters( 'theme_action_links', array_filter( $actions ), $stylesheet, $theme, $context ); + $actions = apply_filters( "theme_action_links_$stylesheet", $actions, $stylesheet, $theme, $context ); $class = ! $allowed ? 'inactive' : 'active'; $checkbox_id = "checkbox_" . md5( $theme->get('Name') ); - $checkbox = ""; + $checkbox = ""; $id = sanitize_html_class( $theme->get_stylesheet() ); @@ -341,7 +342,7 @@ class WP_MS_Themes_List_Table extends WP_List_Table { if ( $theme->get('ThemeURI') ) $theme_meta[] = '' . __( 'Visit Theme Site' ) . ''; - $theme_meta = apply_filters( 'theme_row_meta', $theme_meta, $theme_key, $theme, $status ); + $theme_meta = apply_filters( 'theme_row_meta', $theme_meta, $stylesheet, $theme, $status ); echo implode( ' | ', $theme_meta ); echo ""; @@ -349,7 +350,7 @@ class WP_MS_Themes_List_Table extends WP_List_Table { default: echo ""; - do_action( 'manage_themes_custom_column', $column_name, $theme_key, $theme ); + do_action( 'manage_themes_custom_column', $column_name, $stylesheet, $theme ); echo ""; } } @@ -357,8 +358,8 @@ class WP_MS_Themes_List_Table extends WP_List_Table { echo ""; if ( $this->is_site_themes ) - remove_action( "after_theme_row_$theme_key", 'wp_theme_update_row' ); - do_action( 'after_theme_row', $theme_key, $theme, $status ); - do_action( "after_theme_row_$theme_key", $theme_key, $theme, $status ); + remove_action( "after_theme_row_$stylesheet", 'wp_theme_update_row' ); + do_action( 'after_theme_row', $stylesheet, $theme, $status ); + do_action( "after_theme_row_$stylesheet", $stylesheet, $theme, $status ); } } diff --git a/wp-admin/includes/class-wp-themes-list-table.php b/wp-admin/includes/class-wp-themes-list-table.php index 59942e22f3..91553dbf6e 100644 --- a/wp-admin/includes/class-wp-themes-list-table.php +++ b/wp-admin/includes/class-wp-themes-list-table.php @@ -143,7 +143,7 @@ class WP_Themes_List_Table extends WP_List_Table { . __( 'Live Preview' ) . ''; if ( ! is_multisite() && current_user_can( 'delete_themes' ) ) - $actions['delete'] = '' . __( 'Delete' ) . ''; diff --git a/wp-admin/includes/class-wp-upgrader.php b/wp-admin/includes/class-wp-upgrader.php index bf7e8422be..b954798366 100644 --- a/wp-admin/includes/class-wp-upgrader.php +++ b/wp-admin/includes/class-wp-upgrader.php @@ -1502,7 +1502,7 @@ class Theme_Installer_Skin extends WP_Upgrader_Skin { 'preview' => 1, 'template' => urlencode( $template ), 'stylesheet' => urlencode( $stylesheet ), - ), trailingslashit( get_home_url() ) ); + ), trailingslashit( home_url() ) ); $activate_link = add_query_arg( array( 'action' => 'activate', @@ -1517,7 +1517,7 @@ class Theme_Installer_Skin extends WP_Upgrader_Skin { $install_actions['activate'] = '' . __('Activate') . ''; if ( is_network_admin() && current_user_can( 'manage_network_themes' ) ) - $install_actions['network_enable'] = '' . __( 'Network Enable' ) . ''; + $install_actions['network_enable'] = '' . __( 'Network Enable' ) . ''; if ( $this->type == 'web' ) $install_actions['themes_page'] = '' . __('Return to Theme Installer') . ''; @@ -1566,7 +1566,7 @@ class Theme_Upgrader_Skin extends WP_Upgrader_Skin { 'preview' => 1, 'template' => urlencode( $template ), 'stylesheet' => urlencode( $stylesheet ), - ), trailingslashit( get_home_url() ) ); + ), trailingslashit( home_url() ) ); $activate_link = add_query_arg( array( 'action' => 'activate', diff --git a/wp-admin/includes/theme.php b/wp-admin/includes/theme.php index 79bf0478b2..1e26c0bac9 100644 --- a/wp-admin/includes/theme.php +++ b/wp-admin/includes/theme.php @@ -23,7 +23,7 @@ function delete_theme($stylesheet, $redirect = '') { ob_start(); if ( empty( $redirect ) ) - $redirect = wp_nonce_url('themes.php?action=delete&stylesheet=' . $stylesheet, 'delete-theme_' . $stylesheet); + $redirect = wp_nonce_url('themes.php?action=delete&stylesheet=' . urlencode( $stylesheet ), 'delete-theme_' . $stylesheet); if ( false === ($credentials = request_filesystem_credentials($redirect)) ) { $data = ob_get_contents(); ob_end_clean(); diff --git a/wp-admin/theme-editor.php b/wp-admin/theme-editor.php index 5016ad8cc4..c9adabe0cd 100644 --- a/wp-admin/theme-editor.php +++ b/wp-admin/theme-editor.php @@ -46,7 +46,7 @@ get_current_screen()->set_help_sidebar( wp_reset_vars( array( 'action', 'error', 'file', 'theme' ) ); if ( $theme ) - $stylesheet = urldecode( $theme ); + $stylesheet = $theme; else $stylesheet = get_stylesheet(); @@ -68,7 +68,7 @@ if ( empty( $file ) ) { $relative_file = 'style.css'; $file = $allowed_files['style.css']; } else { - $relative_file = urldecode( stripslashes( $file ) ); + $relative_file = stripslashes( $file ); $file = $theme->get_stylesheet_directory() . '/' . $relative_file; }