Skip to content

Commit

Permalink
Make get_header_image() ssl-aware. fixes #14835.
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.automattic.com/wordpress/trunk@16846 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information
nacin committed Dec 9, 2010
1 parent 5fd4580 commit 0036c52
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions wp-includes/theme.php
Expand Up @@ -1415,9 +1415,16 @@ function header_textcolor() {
* @return string * @return string
*/ */
function get_header_image() { 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;
} }


/** /**
Expand Down

0 comments on commit 0036c52

Please sign in to comment.