Fix old-school Preview links when a theme directory contains spaces. Fix the theme-editor.php link from MS themes screens when a theme directory contains spaces. see #21749.

git-svn-id: http://core.svn.wordpress.org/trunk@21752 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2012-09-04 22:25:25 +00:00
parent 51a2425fe8
commit d476c22aa1
3 changed files with 10 additions and 10 deletions

View File

@ -287,7 +287,7 @@ class WP_MS_Themes_List_Table extends WP_List_Table {
} }
if ( current_user_can('edit_themes') ) if ( current_user_can('edit_themes') )
$actions['edit'] = '<a href="' . esc_url('theme-editor.php?theme=' . $theme_key ) . '" title="' . esc_attr__('Open this theme in the Theme Editor') . '" class="edit">' . __('Edit') . '</a>'; $actions['edit'] = '<a href="' . esc_url('theme-editor.php?theme=' . urlencode( $theme_key ) ) . '" title="' . esc_attr__('Open this theme in the Theme Editor') . '" class="edit">' . __('Edit') . '</a>';
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 && $theme_key != get_option( 'stylesheet' ) && $theme_key != get_option( 'template' ) )
$actions['delete'] = '<a href="' . esc_url( wp_nonce_url( 'themes.php?action=delete-selected&amp;checked[]=' . $theme_key . '&amp;theme_status=' . $context . '&amp;paged=' . $page . '&amp;s=' . $s, 'bulk-themes' ) ) . '" title="' . esc_attr__( 'Delete this theme' ) . '" class="delete">' . __( 'Delete' ) . '</a>'; $actions['delete'] = '<a href="' . esc_url( wp_nonce_url( 'themes.php?action=delete-selected&amp;checked[]=' . $theme_key . '&amp;theme_status=' . $context . '&amp;paged=' . $page . '&amp;s=' . $s, 'bulk-themes' ) ) . '" title="' . esc_attr__( 'Delete this theme' ) . '" class="delete">' . __( 'Delete' ) . '</a>';

View File

@ -128,7 +128,7 @@ class WP_Themes_List_Table extends WP_List_Table {
$activate_link = wp_nonce_url( "themes.php?action=activate&amp;template=" . urlencode( $template ) . "&amp;stylesheet=" . urlencode( $stylesheet ), 'switch-theme_' . $stylesheet ); $activate_link = wp_nonce_url( "themes.php?action=activate&amp;template=" . urlencode( $template ) . "&amp;stylesheet=" . urlencode( $stylesheet ), 'switch-theme_' . $stylesheet );
$preview_link = esc_url( add_query_arg( $preview_link = esc_url( add_query_arg(
array( 'preview' => 1, 'template' => $template, 'stylesheet' => $stylesheet, 'preview_iframe' => true, 'TB_iframe' => 'true' ), array( 'preview' => 1, 'template' => urlencode( $template ), 'stylesheet' => urlencode( $stylesheet ), 'preview_iframe' => true, 'TB_iframe' => 'true' ),
home_url( '/' ) ) ); home_url( '/' ) ) );
$actions = array(); $actions = array();

View File

@ -1500,14 +1500,14 @@ class Theme_Installer_Skin extends WP_Upgrader_Skin {
$preview_link = add_query_arg( array( $preview_link = add_query_arg( array(
'preview' => 1, 'preview' => 1,
'template' => $template, 'template' => urlencode( $template ),
'stylesheet' => $stylesheet, 'stylesheet' => urlencode( $stylesheet ),
), trailingslashit( get_home_url() ) ); ), trailingslashit( get_home_url() ) );
$activate_link = add_query_arg( array( $activate_link = add_query_arg( array(
'action' => 'activate', 'action' => 'activate',
'template' => $template, 'template' => urlencode( $template ),
'stylesheet' => $stylesheet, 'stylesheet' => urlencode( $stylesheet ),
), admin_url('themes.php') ); ), admin_url('themes.php') );
$activate_link = wp_nonce_url( $activate_link, 'switch-theme_' . $stylesheet ); $activate_link = wp_nonce_url( $activate_link, 'switch-theme_' . $stylesheet );
@ -1564,14 +1564,14 @@ class Theme_Upgrader_Skin extends WP_Upgrader_Skin {
$preview_link = add_query_arg( array( $preview_link = add_query_arg( array(
'preview' => 1, 'preview' => 1,
'template' => $template, 'template' => urlencode( $template ),
'stylesheet' => $stylesheet, 'stylesheet' => urlencode( $stylesheet ),
), trailingslashit( get_home_url() ) ); ), trailingslashit( get_home_url() ) );
$activate_link = add_query_arg( array( $activate_link = add_query_arg( array(
'action' => 'activate', 'action' => 'activate',
'template' => $template, 'template' => urlencode( $template ),
'stylesheet' => $stylesheet, 'stylesheet' => urlencode( $stylesheet ),
), admin_url('themes.php') ); ), admin_url('themes.php') );
$activate_link = wp_nonce_url( $activate_link, 'switch-theme_' . $stylesheet ); $activate_link = wp_nonce_url( $activate_link, 'switch-theme_' . $stylesheet );