From e3f00bb19e3082a457954f8c7697d9d83d6a76d3 Mon Sep 17 00:00:00 2001
From: Andrew Freemantle <AndrewFreemantle@users.noreply.github.com>
Date: Fri, 23 Aug 2024 11:30:17 +0100
Subject: [PATCH] fix(is_ssl): adds check for ssl when behind a proxy or load
 balancer

---
 wp-includes/load.php | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/wp-includes/load.php b/wp-includes/load.php
index b0b8209235..d0a788d16a 100644
--- a/wp-includes/load.php
+++ b/wp-includes/load.php
@@ -1625,6 +1625,8 @@ function is_ssl() {
 		}
 	} elseif ( isset( $_SERVER['SERVER_PORT'] ) && ( '443' === (string) $_SERVER['SERVER_PORT'] ) ) {
 		return true;
+	} elseif ( isset( $_SERVER['HTTP_X_FORWARDED_PROTO'] ) && ('https' === strtolower( $_SERVER['HTTP_X_FORWARDED_PROTO'] ) ) ) {
+		return true;
 	}
 
 	return false;
-- 
2.46.0

