Make WordPress Core

Changeset 21752


Ignore:
Timestamp:
09/04/2012 10:25:25 PM (14 years ago)
Author:
nacin
Message:

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.

Location:
trunk/wp-admin/includes
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/class-wp-ms-themes-list-table.php

    r21198 r21752  
    288288
    289289                if ( current_user_can('edit_themes') )
    290                         $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>';
     290                        $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>';
    291291
    292292                if ( ! $allowed && current_user_can( 'delete_themes' ) && ! $this->is_site_themes && $theme_key != get_option( 'stylesheet' ) && $theme_key != get_option( 'template' ) )
  • trunk/wp-admin/includes/class-wp-themes-list-table.php

    r21650 r21752  
    129129
    130130                        $preview_link = esc_url( add_query_arg(
    131                                 array( 'preview' => 1, 'template' => $template, 'stylesheet' => $stylesheet, 'preview_iframe' => true, 'TB_iframe' => 'true' ),
     131                                array( 'preview' => 1, 'template' => urlencode( $template ), 'stylesheet' => urlencode( $stylesheet ), 'preview_iframe' => true, 'TB_iframe' => 'true' ),
    132132                                home_url( '/' ) ) );
    133133
  • trunk/wp-admin/includes/class-wp-upgrader.php

    r21236 r21752  
    15011501                $preview_link = add_query_arg( array(
    15021502                        'preview'    => 1,
    1503                         'template'   => $template,
    1504                         'stylesheet' => $stylesheet,
     1503                        'template'   => urlencode( $template ),
     1504                        'stylesheet' => urlencode( $stylesheet ),
    15051505                ), trailingslashit( get_home_url() ) );
    15061506
    15071507                $activate_link = add_query_arg( array(
    15081508                        'action'     => 'activate',
    1509                         'template'   => $template,
    1510                         'stylesheet' => $stylesheet,
     1509                        'template'   => urlencode( $template ),
     1510                        'stylesheet' => urlencode( $stylesheet ),
    15111511                ), admin_url('themes.php') );
    15121512                $activate_link = wp_nonce_url( $activate_link, 'switch-theme_' . $stylesheet );
    … …  
    15651565                        $preview_link = add_query_arg( array(
    15661566                                'preview'    => 1,
    1567                                 'template'   => $template,
    1568                                 'stylesheet' => $stylesheet,
     1567                                'template'   => urlencode( $template ),
     1568                                'stylesheet' => urlencode( $stylesheet ),
    15691569                        ), trailingslashit( get_home_url() ) );
    15701570
    15711571                        $activate_link = add_query_arg( array(
    15721572                                'action'     => 'activate',
    1573                                 'template'   => $template,
    1574                                 'stylesheet' => $stylesheet,
     1573                                'template'   => urlencode( $template ),
     1574                                'stylesheet' => urlencode( $stylesheet ),
    15751575                        ), admin_url('themes.php') );
    15761576                        $activate_link = wp_nonce_url( $activate_link, 'switch-theme_' . $stylesheet );
Note: See TracChangeset for help on using the changeset viewer.