From f769530af373db4f9e905a670de6da9af3498dcb Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Thu, 5 Jun 2014 14:09:18 +0000 Subject: [PATCH] Force SSL admin when siteurl is explicitly configured with HTTPS. see #27954. Built from https://develop.svn.wordpress.org/trunk@28674 git-svn-id: http://core.svn.wordpress.org/trunk@28492 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/default-constants.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/wp-includes/default-constants.php b/wp-includes/default-constants.php index 3214bfc7cb..c5b3390ad6 100644 --- a/wp-includes/default-constants.php +++ b/wp-includes/default-constants.php @@ -247,8 +247,13 @@ function wp_ssl_constants() { /** * @since 2.6.0 */ - if ( !defined( 'FORCE_SSL_ADMIN' ) ) - define( 'FORCE_SSL_ADMIN', false ); + if ( !defined( 'FORCE_SSL_ADMIN' ) ) { + if ( 'https' === parse_url( get_option( 'siteurl' ), PHP_URL_SCHEME ) ) { + define( 'FORCE_SSL_ADMIN', true ); + } else { + define( 'FORCE_SSL_ADMIN', false ); + } + } force_ssl_admin( FORCE_SSL_ADMIN ); /**