From a6d6ba957b92d10f35c803b4caede683a501a41c Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Sat, 10 Jan 2015 21:08:22 +0000 Subject: [PATCH] `get_header_image()` can return `false`. In `Custom_Image_Header->step_1()`, check the value before setting the `background-image` portion of the `style` attribute. Setting the the URL to empty string will cause the current request to be set as the source of the background image. See #30799. Built from https://develop.svn.wordpress.org/trunk@31130 git-svn-id: http://core.svn.wordpress.org/trunk@31111 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/custom-header.php | 9 ++++++++- wp-includes/version.php | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/wp-admin/custom-header.php b/wp-admin/custom-header.php index 623a1fad29..eee3f1f1a6 100644 --- a/wp-admin/custom-header.php +++ b/wp-admin/custom-header.php @@ -554,7 +554,14 @@ class Custom_Image_Header { call_user_func( $this->admin_image_div_callback ); } else { $custom_header = get_custom_header(); - $header_image_style = 'background-image:url(' . esc_url( get_header_image() ) . ');'; + $header_image = get_header_image(); + + if ( $header_image ) { + $header_image_style = 'background-image:url(' . esc_url( $header_image ) . ');'; + } else { + $header_image_style = ''; + } + if ( $custom_header->width ) $header_image_style .= 'max-width:' . $custom_header->width . 'px;'; if ( $custom_header->height ) diff --git a/wp-includes/version.php b/wp-includes/version.php index d286c39bc2..6b0454d26a 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.2-alpha-31129'; +$wp_version = '4.2-alpha-31130'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.