WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 4 years ago

#31631 closed defect (bug) (fixed)

Issue with "HTML escaping" in theme customizer

Reported by: tititou36 Owned by: ocean90
Milestone: 4.3 Priority: normal
Severity: normal Version: 4.1
Component: Customize Keywords:
Focuses: Cc:
PR Number:

Description

Hi,

there seems to be an issue in the "HTML escaping" in theme customizer.

Attached a screen-shot of the French twentyfifteen theme, included with WP 4.1.1
What is strange to is that "Image d'arrière-plan" seems to be declared only once within the fr-FR PO file

#: wp-includes/class-wp-customize-control.php:894
#: wp-includes/class-wp-customize-manager.php:1099
msgid "Background Image"
msgstr "Image d’arrière-plan"

but it is displayed correctly on one line and incorrectly on the 2nd one. So I assume it is an issue in the customizer (or in the theme itself), but not in the French translation.

Thanks.
CJ

Attachments (1)

theme.jpg (27.9 KB) - added by tititou36 5 years ago.
Screen-shot

Download all attachments as: .zip

Change History (9)

@tititou36
5 years ago

Screen-shot

#1 @SergeyBiryukov
5 years ago

  • Component changed from Themes to Customize

#3 @ocean90
4 years ago

  • Milestone changed from Awaiting Review to 4.3

Related: #32670

#4 @ocean90
4 years ago

  • Owner set to ocean90
  • Resolution set to fixed
  • Status changed from new to closed

In 32885:

Customizer: Decode HTML entities in the label property of WP_Customize_Media_Control.

fixes #31631.

#5 follow-up: @Collizo4sky
4 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Just to chime in, a CSS with the following code added to a customizer textarea (for example, in my theme its a custom css textarea) will have the > escaped to >

.content > #header

Becomes

.content > #header

#6 in reply to: ↑ 5 ; follow-up: @ocean90
4 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed
  • Version changed from 4.1.1 to 4.1

Replying to Collizo4sky:

Hello @Collizo4sky, can you please open a new ticket for that? Please also include some code for testing and the steps to reproduce your issue. Thanks!

#7 in reply to: ↑ 6 ; follow-up: @Collizo4sky
4 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Replying to ocean90:

Replying to Collizo4sky:

Hello @Collizo4sky, can you please open a new ticket for that? Please also include some code for testing and the steps to reproduce your issue. Thanks!

I would have done so but am not sure if this is the fault of the theme author or customizer because i don't know if the customizer API include a callback function for sanitizing user input which the theme author might be using wrongly.

Here is the code for the custom css in customizer the theme is using. See if you can spot any problem.

<?php
function customcss_customizer( $wp_customize ) {
    $wp_customize->add_section(
        'customcss_section',
        array(
            'title' => 'Custom CSS',
            'description' => 'Insert Custom CSS lines here',
            'priority' => 41,
        )
    );
    
    $wp_customize->add_setting( 'tb_webpaint_customcss',array(
    	'transport' => 'postMessage',
    	'sanitize_callback' => 'textonly_sanitize') );
	$wp_customize->add_control(
	    new tb_textarea_Control(
	        $wp_customize,
	        'tb_webpaint_customcss',
	        array(
	            'label' => 'Custom CSS',
	            'section' => 'customcss_section',
	            'settings' => 'tb_webpaint_customcss'
	        )
	    )
	);	
        	
   if ( $wp_customize->is_preview() && ! is_admin() ){
    	add_action( 'wp_footer', 'customcss_customizer_preview', 21);
    }
    
}
add_action( 'customize_register', 'customcss_customizer' );

function customcss_customizer_preview() {
   ?>
    <script type="text/javascript">
        ( function() {
            wp.customize('tb_webpaint_customcss',function( value ) {
                value.bind(function(to) {
                	jQuery("#customizercss").text(to);
                });
            }); 
        } )( jQuery )
    </script>
<?php
}  // End function example_customize_preview()

?>

#8 in reply to: ↑ 7 @ocean90
4 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

Replying to Collizo4sky:

In this case please contact author of your theme and/or use our Support Forums for troubleshooting.

Please do not reopen this ticket as your issue isn't related to this. Thank you.

Note: See TracTickets for help on using tickets.