From 0dcce859fb563c317e38921f7e86d7576b82ab22 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Thu, 5 Jun 2014 14:08:11 +0000 Subject: [PATCH] Force SSL admin when siteurl is explicitly configured with HTTPS. see #27954. git-svn-id: https://develop.svn.wordpress.org/trunk@28674 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/default-constants.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/wp-includes/default-constants.php b/src/wp-includes/default-constants.php index 3214bfc7cb..c5b3390ad6 100644 --- a/src/wp-includes/default-constants.php +++ b/src/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 ); /**