From 592c3fc7d76a067d93109d1da305bdf4d754573a Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Fri, 9 Dec 2016 01:43:42 +0000 Subject: [PATCH] Customize: Use `esc_url_raw()` instead of `wp_json_encode()` to eliminate extraneous slashes when outputting background image URL in CSS `url()`. Props tyxla, westonruter. See #22058. Fixes #39145. Built from https://develop.svn.wordpress.org/trunk@39546 git-svn-id: http://core.svn.wordpress.org/trunk@39486 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/theme.php | 2 +- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/theme.php b/wp-includes/theme.php index 8aac86c9f7..db6016d7c3 100644 --- a/wp-includes/theme.php +++ b/wp-includes/theme.php @@ -1554,7 +1554,7 @@ function _custom_background_cb() { $style = $color ? "background-color: #$color;" : ''; if ( $background ) { - $image = " background-image: url(" . wp_json_encode( $background ) . ");"; + $image = ' background-image: url("' . esc_url_raw( $background ) . '");'; // Background Position. $position_x = get_theme_mod( 'background_position_x', get_theme_support( 'custom-background', 'default-position-x' ) ); diff --git a/wp-includes/version.php b/wp-includes/version.php index 1f8f6aa1df..817daa894b 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.8-alpha-39545'; +$wp_version = '4.8-alpha-39546'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.