From 95f9ddbe451006bf664a794913d3df05a224fbb2 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Tue, 8 Apr 2025 18:04:29 +0000 Subject: [PATCH] General: Correct `force_ssl_content()` to always return a boolean value. This aims to bring parity with `force_ssl_admin()`. Includes: * Allowing `force_ssl_content()` to properly accept `false` as a value. * Correcting an erroneous `! $force` conditional that should have been reversed. * Adding unit tests to confirm valid behavior. Follow-up to [https://mu.trac.wordpress.org/changeset/1979 mu:1979], [11903], [12603], [47808], [59830]. Props justlevine for initial patch. See #52217. Built from https://develop.svn.wordpress.org/trunk@60147 git-svn-id: http://core.svn.wordpress.org/trunk@59483 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/ms-functions.php | 8 ++++---- wp-includes/version.php | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/wp-includes/ms-functions.php b/wp-includes/ms-functions.php index b3fc55a6d3..7b87c1fb7c 100644 --- a/wp-includes/ms-functions.php +++ b/wp-includes/ms-functions.php @@ -2420,15 +2420,15 @@ Thanks! * * @since 2.8.5 * - * @param bool $force + * @param bool|null $force Optional. Whether to force SSL in admin screens. Default null. * @return bool True if forced, false if not forced. */ -function force_ssl_content( $force = '' ) { +function force_ssl_content( $force = null ) { static $forced_content = false; - if ( ! $force ) { + if ( ! is_null( $force ) ) { $old_forced = $forced_content; - $forced_content = $force; + $forced_content = (bool) $force; return $old_forced; } diff --git a/wp-includes/version.php b/wp-includes/version.php index de3c5e0df8..70b954d00e 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.9-alpha-60142'; +$wp_version = '6.9-alpha-60147'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.