mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
Customizer: Escape theme preview URLs.
props johnbillion, ocean90. see #31896. git-svn-id: https://develop.svn.wordpress.org/trunk@32134 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1243,7 +1243,8 @@ class WP_Customize_Theme_Control extends WP_Customize_Control {
|
||||
*/
|
||||
public function content_template() {
|
||||
$current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
|
||||
$preview_url = add_query_arg( 'theme', '{{ data.theme.id }}', $current_url );
|
||||
$preview_url = esc_url( add_query_arg( 'theme', '__THEME__', $current_url ) ); // Token because esc_url() strips curly braces.
|
||||
$preview_url = str_replace( '__THEME__', '{{ data.theme.id }}', $preview_url );
|
||||
?>
|
||||
<div class="theme" tabindex="0" data-preview-url="<?php echo esc_attr( $preview_url ); ?>" aria-describedby="{{ data.theme.id }}-action {{ data.theme.id }}-name">
|
||||
<# if ( data.theme.screenshot[0] ) { #>
|
||||
|
||||
Reference in New Issue
Block a user