WordPress.org

Make WordPress Core


Ignore:
Timestamp:
04/15/2015 04:32:03 PM (5 years ago)
Author:
ocean90
Message:

Customizer: Escape theme preview URLs.

props johnbillion, ocean90.
see #31896.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-customize-control.php

    r32088 r32134  
    12441244    public function content_template() {
    12451245        $current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
    1246         $preview_url = add_query_arg( 'theme', '{{ data.theme.id }}', $current_url );
     1246        $preview_url = esc_url( add_query_arg( 'theme', '__THEME__', $current_url ) ); // Token because esc_url() strips curly braces.
     1247        $preview_url = str_replace( '__THEME__', '{{ data.theme.id }}', $preview_url );
    12471248        ?>
    12481249        <div class="theme" tabindex="0" data-preview-url="<?php echo esc_attr( $preview_url ); ?>" aria-describedby="{{ data.theme.id }}-action {{ data.theme.id }}-name">
Note: See TracChangeset for help on using the changeset viewer.