From 0036c521015ae5ae2dc256848d16fb9889adaa27 Mon Sep 17 00:00:00 2001 From: nacin Date: Thu, 9 Dec 2010 17:59:35 +0000 Subject: [PATCH] Make get_header_image() ssl-aware. fixes #14835. git-svn-id: http://svn.automattic.com/wordpress/trunk@16846 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/theme.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/wp-includes/theme.php b/wp-includes/theme.php index 3506bfa04..e2841c456 100644 --- a/wp-includes/theme.php +++ b/wp-includes/theme.php @@ -1415,9 +1415,16 @@ function header_textcolor() { * @return string */ function get_header_image() { - $default = defined('HEADER_IMAGE') ? HEADER_IMAGE : ''; + $default = defined( 'HEADER_IMAGE' ) ? HEADER_IMAGE : ''; - return get_theme_mod('header_image', $default); + $url = get_theme_mod( 'header_image', $default ); + + if ( is_ssl() ) + $url = str_replace( 'http://', 'https://', $url ); + else + $url = str_replace( 'https://', 'http://', $url ); + + return $url; } /**