Make WordPress Core

Ticket #21241: 21241.patch

File 21241.patch, 1.8 KB (added by cfinke, 13 years ago)

Replaces single percent signs with double percent signs in anticipation of the sprintf call in get_theme_mod.

  • wp-admin/custom-background.php

     
    211211
    212212if ( get_background_image() ) {
    213213        // background-image URL must be single quote, see below
    214         $background_styles .= ' background-image: url(\'' . set_url_scheme( get_theme_mod( 'background_image_thumb', get_background_image() ) ) . '\');'
     214        $background_styles .= ' background-image: url(\'' . set_url_scheme( get_theme_mod( 'background_image_thumb', str_replace( '%', '%%', get_background_image() ) ) ) . '\');'
    215215                . ' background-repeat: ' . get_theme_mod('background_repeat', 'repeat') . ';'
    216216                . ' background-position: top ' . get_theme_mod('background_position_x', 'left');
    217217}
    218218?>
    219219<div id="custom-background-image" style="<?php echo $background_styles; ?>"><?php // must be double quote, see above ?>
    220220<?php if ( get_background_image() ) { ?>
    221 <img class="custom-background-image" src="<?php echo set_url_scheme( get_theme_mod( 'background_image_thumb', get_background_image() ) ); ?>" style="visibility:hidden;" alt="" /><br />
    222 <img class="custom-background-image" src="<?php echo set_url_scheme( get_theme_mod( 'background_image_thumb', get_background_image() ) ); ?>" style="visibility:hidden;" alt="" />
     221<img class="custom-background-image" src="<?php echo set_url_scheme( get_theme_mod( 'background_image_thumb', str_replace( '%', '%%', get_background_image() ) ) ); ?>" style="visibility:hidden;" alt="" /><br />
     222<img class="custom-background-image" src="<?php echo set_url_scheme( get_theme_mod( 'background_image_thumb', str_replace( '%', '%%', get_background_image() ) ) ); ?>" style="visibility:hidden;" alt="" />
    223223<?php } ?>
    224224</div>
    225225<?php } ?>