From 7a5f49acaa8e5fb1aac357a525327e20e5e9991d Mon Sep 17 00:00:00 2001 From: holan20180123 Date: Tue, 3 Aug 2021 10:08:56 +0800 Subject: [PATCH] * Finish task #40817. --- module/doc/view/content.html.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/module/doc/view/content.html.php b/module/doc/view/content.html.php index 655313b6e8..42f82a83fa 100644 --- a/module/doc/view/content.html.php +++ b/module/doc/view/content.html.php @@ -73,8 +73,9 @@ $sessionString .= session_name() . '=' . session_id(); { $url = $doc->content; if(!preg_match('/^https?:\/\//', $doc->content)) $url = 'http://' . $url; - $urlIsHttps = strpos($url, 'https://') === 0; + $urlIsHttps = strpos($url, 'https://') === 0; $serverIsHttps = ((isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == 'on') or (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) and strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']) == 'https')); + if(($urlIsHttps and $serverIsHttps) or (!$urlIsHttps and !$serverIsHttps)) { echo "";